Probably really easy for a pro, but could someone re-write this from it's PHP shorthand form to non-shorthand?
($facebook) ? $fb_active_session = $facebook->fbc_is_session_active() : $fb_active_session = false;
Thanks!
Probably really easy for a pro, but could someone re-write this from it's PHP shorthand form to non-shorthand?
($facebook) ? $fb_active_session = $facebook->fbc_is_session_active() : $fb_active_session = false;
Thanks!
if($facebook) {
$fb_active_session = $facebook->fbc_is_session_active();
} else {
$fb_active_session = false;
}
$fb_active_session = false;
if($facebook)
{
$fb_active_session = $facebook->fbc_is_session_active();
}
It would have been better and more clearly written (still using the ternary op) as:
$fb_active_session = ($facebook) ? $facebook->fbc_is_session_active() : false;
Think of it like this:
IS $facebook TRUE ? THEN DO THIS : IF NOT, THIS ;