I like to use a php function to switch between ON and OFF automatically upon the call.
Of course something simple like
$condition="OFF";
switch ($condition) {
case "OFF" :
$condition="ON";
break;
case "ON" :
$condition="OFF";
break;
}
this always returns ON but that is not what I need. How can I make it so that it remember the previous setting of $condition and act accordingly so it alternate between ON/Off automatically upon the call to the function?
Thanks
Of course something simple like
$condition="OFF";
switch ($condition) {
case "OFF" :
$condition="ON";
break;
case "ON" :
$condition="OFF";
break;
}
this always returns ON but that is not what I need. How can I make it so that it remember the previous setting of $condition and act accordingly so it alternate between ON/Off automatically upon the call to the function?
Thanks