check array values for all NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have an array that is initialised with many keys and all values set to NULL. I'd like to be able to test these values later to see if any of them have been set. I tried:

if (!empty(array_values($the_array)))

but that's not allowed, so:

$array_check = array_values($the_array);
if (!empty($array_check))

but that doesn't work, either, because, though the values of *that* array are all NULL, the array itself is not empty.

Now, i know that i can simply set some $var to TRUE whenever one of the array vales is set. And i can also just test them in a loop. But my curiosity has gotten the better of me.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux