The function empty()
determines whether a variable is considered to be empty. The following things are considered to be empty:
It’s the same list as for the things that make $a evaluate to false in an expression.
if (empty($sp[0])) { form_destroy(); die('Subject phrases missing 467778777. -Programmer.'); }
I think this could have been written more simply as:
if (!$sp[0]) { form_destroy(); die('Subject phrases missing 467778777. -Programmer.'); }
If you disagree then please comment below.
Thanks for pointing that out:)
Sam,
The difference between using empty($a[0]) and !$a[0] is that empty() will not generate a warning when $a[0] is not set. You won’t notice it with error reporting turned down, but if it’s set to E_WARNING or E_NOTICE it’ll start triggering errors.