You are here: Re: Strange comparison behaviour « PHP « IT news, forums, messages
Re: Strange comparison behaviour

Posted by Bogdan Stancescu on 05/13/05 12:13

You probably mis-typed something:

[bogdan@myserver ~]$ php
<?
if ("info" == 0) echo "is 0\n"; else echo "not 0\n";
?>
Content-type: text/html
X-Powered-By: PHP/4.3.11

is 0

Cheers,
Bogdan

Erwin Kerk wrote:
> Hi All,
>
> Can anyone explain me why the following code:
>
> if ("info" == 0) echo "is 0\n"; else echo "not 0\n";
>
> Results in: not 0
>
>
> Whereas:
>
> if ("inf" == 0) echo "is 0\n"; else echo "not 0\n";
>
> Results in: is 0
>
>
>
> Notice the difference: info in the first sample, inf in the second sample.
>
>
> The used PHP version is PHP 4.1.2 (CLI version)
>
>
> Erwin Kerk

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация