Hi-
I'm trying to figure out how to compare all the values in a given array, and, if they are all the same (equal to NULL, actually), I'd like to unset the array.
Any ideas? Thanks.
Hope this helps.
if (count($blah) < 1) unset($blah);
The count method doesn't work because the array actually contains 9 rows, they are just NULL values.
Try this.
for ($i = 0; $i < count($arr); $i++) { if ($arr == NULL) { continue; } else { $all_null = false; break; } }