It often happens to me to handle data that can be either an array or a null variable and to feed some foreach with these data.
foreach
$values = get_val
i would do the same thing as Andy but i'ld use the 'empty' function.
like so:
if(empty($yourArray)) {echo"There's nothing in the array.....";} else { foreach ($yourArray as $current_array_item) { //do something with the current array item here } }
There's nothing in the array.....