1 2 3 4 5 6 7 8 9
<?php $arr=array(); echo "The array is ", $arr ? 'full' : 'empty', ".\n"; $label = array(0 => 'empty', 1 => 'full'); echo "The array is ", $label[(bool)$arr], ".\n";
1 2
The array is empty. The array is empty.