Page 1 of 1

Other technique of using if then else statement

Posted: Thu Aug 09, 2007 6:11 pm
by webgroundz
@all

i just wanna ask what do you call other technique of using if then else statement?
like this one :

Code: Select all

<?php ((count($this->getErrorMessages())) ? FALSE : TRUE; ?>
i forgot the keyword

:cry:

thanks for helping in advanced... :D :D :D

Posted: Thu Aug 09, 2007 7:06 pm
by Christopher
It called the "ternary conditional operator" and though it should be in the manual here:

http://www.php.net/manual/en/language.c ... ctures.php

It is slightly hidden here:

http://www.php.net/manual/en/language.expressions.php


PS - doesn't someone here work on the PHP documentation? This should probably be in both the expressions and if sections.

Posted: Fri Aug 10, 2007 3:23 am
by stereofrog
arborint wrote:It called the "ternary conditional operator" and though it should be in the manual here:

http://www.php.net/manual/en/language.c ... ctures.php
Well, technically it's an operator (like + or *), not a statement (like "if" or "while").