On Tue, 13 Jul 2004 01:57:48 +1000, Justin French
<[EMAIL PROTECTED]> wrote:
> [...] My hope
> was that there was such a function to delete empty array elements
> already defined in PHP, but since it appears there isn't, I'll just
> keep including my own from a library file.
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.
pb
--
paul bissex, e-scribe.com -- database-driven web development
413.585.8095
69.55.225.29
01061-0847
72�39'71"W 42�19'42"N
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php