1 2 3 4 5 6 7 8
<?php $array = array(1,2,""); foreach($array as $key => $value) { if (empty($value)) echo "$key empty <br/>"; else echo "$key not empty <br/>"; }
1
0 not empty <br/>1 not empty <br/>2 empty <br/>