Hi all,
I'm getting a strange result with the following IF statement:
$bar = ($foo == 'last') ? true : false;
In my script $foo normaly has a integer value greater than 0, but can have
last as value. But whatever value of $foo $bar always becomes true.
When I use the regular if {....}else{.... } I get the same result, always
$bar becomes true.
I've played around with a couple things, like turning the statement around
($foo != 'last') but nothing seems to give the desired result.
Can anyone tell me what I'm doing wrong or how to fix this.
Thanx,
J-P
I'm getting a strange result with the following IF statement:
$bar = ($foo == 'last') ? true : false;
In my script $foo normaly has a integer value greater than 0, but can have
last as value. But whatever value of $foo $bar always becomes true.
When I use the regular if {....}else{.... } I get the same result, always
$bar becomes true.
I've played around with a couple things, like turning the statement around
($foo != 'last') but nothing seems to give the desired result.
Can anyone tell me what I'm doing wrong or how to fix this.
Thanx,
J-P
Comment