You are here: Re: short if else « PHP Programming Language « IT news, forums, messages
Re: short if else

Posted by David Haynes on 12/28/05 16:42

Oli Filth wrote:
> black francis said the following on 28/12/2005 14:37:
>> try:
>>
>> $do = ($test == 1) ? true : false;
>
> Well, that can be shortened to:
>
> $do = ($test == 1);
>
>
Which can be shortened to:

$do = $test;

unless $test = 0, $do will evaluate as false.

-david-

 

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

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