Other technique of using if then else statement

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
webgroundz
Forum Commoner
Posts: 58
Joined: Thu Jun 21, 2007 1:20 am
Location: Philippines

Other technique of using if then else statement

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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.
(#10850)
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Post 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").
Post Reply