if ($toggle) { $toggle = 0; } else { $toggle = 1; }
can be written as
$toggle = $toggle ? 0 : 1;
And if you wanted a bitwise toggle, you could do
$toggle ^= 1;
But you asked for boolean, so you want the even simpler:
$toggle = !$toggle;
In reply to Re: Boolean counter?
by ikegami
in thread Boolean counter?
by DreamT
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |