Re: Variable Strangeness
| From: | Chris Lee | Date: | Wed, 21 Feb 2001 17:12:55 +0000 |
| Subject: | Re: Variable Strangeness | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-41002@lists.php.net to get a copy of this message | ||
or...
<?php
$confidential = 0;
echo "$confidential " . ((string)$confidential == 'yes');
?>
that forces the comparison to be compared as a string. this only has to be
done sometimes, usually php is quite good at determining what you want.
--
Chris Lee
Mediawaveonline.com
em. lee@mediawaveonline.com
ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120
"Jason Murray" <jason@jwebmedia.com> wrote in message
news:3A93FCE4.EAD0A0F2@jwebmedia.com...
> Hi,
>
> I came across this:
>
> $confidential = 0;
> echo "$confidential " . ($confidential == "yes");
>
> In which "0 1" was printed.
>
> Is there something I'm missing?
>
> Thanks,
> Jason
>
> --
> Jason Murray
> Developer
> http://www.jwebmedia.com/
> 1 877 525 jWEB
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>