S
stephen m
Guest
This is just a tenary.. Its the same as:
$value = 0;
if ( isset($contents[$item]) {
$value = $contents[$item] + 1;
} else {
$value = 1;
}
A tenary is just a nicer, more efficent way of writing it in this case. I remember it like this:
the ? means - if the last thing said is true then do it.. and the : I remember as if - screw it - go ahead and do this instead.
$value = 0;
if ( isset($contents[$item]) {
$value = $contents[$item] + 1;
} else {
$value = 1;
}
A tenary is just a nicer, more efficent way of writing it in this case. I remember it like this:
the ? means - if the last thing said is true then do it.. and the : I remember as if - screw it - go ahead and do this instead.