You are here: Re: what does thsi line do « PHP Language « IT news, forums, messages
Re: what does thsi line do

Posted by chris on 09/17/05 11:35

thanks everyone for the explanations - all is clear now
there are so many different ways to do the same thing in PHP

Chris


"juglesh" <jugleshjunk@hotmail.com> wrote in message
news:1126893818.007680.120670@g43g2000cwa.googlegroups.com...
> http://www.php.net/manual/en/language.operators.comparison.php
> Ternary Operator
> Another conditional operator is the "?:" (or ternary) operator. Example
> 15-3. Assigning a default value
>
> <?php
> // Example usage for: Ternary Operator
> $action = (empty($_POST['action'])) ? 'default' : $_POST['action'];
>
> // The above is identical to this if/else statement
> if (empty($_POST['action'])) {
> $action = 'default';
> } else {
> $action = $_POST['action'];
> }
>
> ?>
>
> The expression (expr1) ? (expr2) : (expr3) evaluates to expr2 if expr1
> evaluates to TRUE, and expr3 if expr1 evaluates to FALSE.
>
> hard one to find if you dont know what yer lookin for.
>

 

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

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