http://www.php.net/manual/en/language.expressions.php
If the value of the first subexpression is *TRUE* (non-zero), then the
second subexpression is evaluated, and that is the result of the conditional
expression. Otherwise, the third subexpression is evaluated, and that is the
value.
---
Weyds
The technical term, in case you're interested, is called a ternary
operator.
http://php.net/manual/en/language.operators.comparison.php
On Aug 5, 12:30 pm, "Dave Maharaj" wrote:
> Can someone explain what the "?" and the ":" mean?
>
> return ($this->meta['head_title'] ? $this->meta['page_header
this is shorten if clouse
so
if (!empty($lol))
print $lol;
else
//do something else...
in shorten will be this:
print (!empty($lol) ? $lol : NULL);
--
LP,
Tilen Majerle http://majerle.eu
2010/8/5 Dave Maharaj
> Can someone explain what the “?” and the ”:” mean?
>
>
>
> return ($this
Can someone explain what the "?" and the ":" mean?
return ($this->meta['head_title'] ? $this->meta['page_header'] : NULL);
Does it mean
return $this->meta['head_title'] IF $this->meta['page_header'] IS NULL / NOT
SET?
I googled it and looked thru php code but cannot seem to find an expla