In PHP I am trying to return TRUE if $counter is greater than 0. Would using a ternary operator work in this case. Here is the original code:
if($counter>0){return TRUE;}else{return FALSE;}
could I condense that down to
return $counter>0?TRUE:FALSE
Thanks
You could condense it to return $counter>0
Because that is a Boolean expression itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With