You are here: Re: simple test « PHP Programming Language « IT news, forums, messages
Re: simple test

Posted by groups2 on 05/02/07 18:50

On May 2, 12:43 am, Hendri Kurniawan <ask...@email.com> wrote:
> grou...@reenie.org wrote:
> > Why does this test as not true.
>
> > if (!1==2) echo 'true'; else echo 'nottrue';
>
> > It seems like it should be true.
>
> IMHO Operator precedence.
> you are negating 1 instead the whole expression.
>
> How to negate whole expression:
> if (!(1==2)) echo 'true'; else echo 'nottrue';
>
> Hendri Kurniawan

Ok thanks. That makes sense. Or, of course,
if (1!=2)) echo 'true'; else echo 'nottrue';

 

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

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