Can anyone explain this impossible bit of PHP logic?
- by user268208
I'm attempting to debug a simple PHP script. Essentially, there's a variable which is defined with:
$variable = ($_GET['variable'] == 'true') ? TRUE : FALSE;
Then, in the view file, the following code is meant to display a box if $variable == TRUE:
<? if ($variable == true) { ?>
<p class="box">You have imported a new plan.</p>
<? } ?>
Now, even when that $variable, as shown by var_dump($variable); == FALSE, that HTML is printed between the if { } tags. To me, this defies logic. I simply can't figure out this problem out.
Furthermore, this code works fine on many PHP4 and PHP5 installations except for one particular server running PHP5.2.
Any possible suggestions? Leads? I'm pulling out my hair trying to figure this one out.
Thank you.