On 13/07/2004, at 3:14 AM, Paul Bissex wrote:
How about array_filter()? From the docs: "If the callback function is not supplied, array_filter() will remove all the entries of input that are equal to FALSE."
$a = array ('a' => 'foo', 'b' => '', 'c' => null, 'd' => 99, 'e' => 0);
print_r (array_filter ($a));
// Output:
Array ( [a] => foo [d] => 99 )
As a previous poster noted, though, this will only work for you if "0" and the empty string et al. are not significant in your application.
Nice idea Paul, will try it out :)
--- Justin French http://indent.com.au
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

