[thelist] stupid PHP question

Jay Blanchard jay.blanchard at niicommunications.com
Thu Jul 7 09:13:34 CDT 2005

What I don't understand is the syntax of this line:

	$row_count = is_array($row) ? count($row) : 0;

This is a ternary comparison form of an IF statement...read it like

if(is_array($row)){ //this is the ?
} else { //this is the :

http://us3.php.net/ternary about 1/3rd down the page.

More information about the thelist mailing list