I am always forgetting how to do this shortcut in PHP so I figured if I post it I will always have it.
(condition ? value if true : value if false)
if ($iamcool==true) {
$x=1;
} else {
$x=2;
}
is the same as
if ($imamcool==true) : $x=1 ? $x=2;
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment