Possible Duplicate:
What is the PHP ? : operator called and what does it do?
I feed like a goof but I don’t entirely understand what’s happening in this code:
$var .= ($one || $two) ? function_one( $one, $another) : function_two( $two, $another);
Does that say if $one or $two then $var is equal to fuction_one(), else function_two()? What’s the purpose of using this syntax — speed?
If either
$oneis true, or$twois true, then the result of callingfunction_oneis appended to$var. Otherwise, the result of callingfunction_twois appended to$var.It’s basically shorthand for: