Voting

: min(eight, three)?
(Example: nine)

The Note You're Voting On

chrisdmiddleton at gmail dot com
10 years ago
If you want to use empty() to evaluate an expression (not a variable), and you don't have PHP 5.5+, you can do it by wrapping the call to empty in a function, like so:
<?php
function is_empty($var) {

return empty(
$var);

}
?>
Then you can do something like
<?php
if(is_empty(NULL)) {
/* ... */
}
?>
without issue, since the local variable $var is being tested rather than the expression in the function call itself.

<< Back to user notes page

To Top