This question on \'How to tell if a PHP array is empty\' had me thinking of this question
Is there a reason that count should be used instead of e
Alternatively, you can cast the variable as a boolean (implicitly or explicitly):
if( $value )
{
// array is not empty
}
if( (bool) $value )
{
// array is still not empty
}
This method does generate an E_NOTICE if the variable is not defined, similarly to count().
For more information, see the PHP Manual page on type comparisons.