> I came across this:
>       $confidential = 0;
>       echo "$confidential " . ($confidential == "yes");
> In which "0 1" was printed.
> Is there something I'm missing?

Yes.  When comparing types, PHP generally typcasts one side
of the operand to the type of what is on the other side.  So in
the above operation, it is typecasting "yes" to an integer and so
becomes a '0' (zero).  Because of that, 0 == 0 and so resolves
true.
What you want to do is

echo "$confidential " . ("$confidential" == "yes");

and you'll get your expected results.

Chris

Reply via email to