Menu
Hello,
I have no idea why these scripts echo “ex” instead of “zero”. Seems straight forward but it’s got me stumped. Any ideas?
[code=php]
$ws=0;
echo $ws.’,’.($ws==’x’?’ex’:’zero’);
exit;
I would expect to see:
0,zero
But instead, it shows:
0,ex
Or…
[code=php]
$ws=0;
$ws=($ws==’x’?’ex’:’zero’);
echo $ws;
exit;
I would expect it to echo “zero”, but it echos “ex”
Any ideas why this is? Incidentally, it doesn’t matter what string I use (or even if I use $ws==0), it consistently displays “ex”.
I appreciate any ideas.
Thanks.