which1ispink which1ispink - 1 year ago 89
PHP Question

What does this PHP syntax mean? (question marks)

What does this line of PHP code mean? That is, the question mark bit followed by true, colon, false?

return(isset($_SESSION['id'])) ? true : false;

kba kba
Answer Source

It's a ternary operator.

It's simply short-hand for:

if (isset($_SESSION['id']))
  return true;
  return false;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download