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 (arr
"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote Justin French:
> > On 12/07/2004, at 6:38 PM, Thomas Seifert wrote:
> >
> > My view of internal functions is that they solve common, repetitive
> > problems. Sure, some of those problems are quite complex, but
* Thus wrote Justin French:
> On 12/07/2004, at 6:38 PM, Thomas Seifert wrote:
>
> My view of internal functions is that they solve common, repetitive
> problems. Sure, some of those problems are quite complex, but others
> are not. A perfect example would be array_walk() -- it can be solved
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
On 12/07/2004, at 6:38 PM, Thomas Seifert wrote:
Really what do you need an internal function for something simple like
that?
It may be simple, but it's 60 characters I have to type over and over,
or a user defined function I have to include() from a library file (and
I have to ensure that librar
Daniel Kullik wrote:
Justin French wrote:
Hi,
Looking for a one-liner to delete all empty elements in an array. I
know I can do it with a foreach loop, but I'm hoping that I've missed
an existing function in the manual which may already do this, or a
simple one-liner to replace the foreach.
$
Justin French wrote:
Hi,
Looking for a one-liner to delete all empty elements in an array. I
know I can do it with a foreach loop, but I'm hoping that I've missed an
existing function in the manual which may already do this, or a simple
one-liner to replace the foreach.
$v) {
if(empty($v)
On Mon, 12 Jul 2004 15:33:53 +1000, Justin French wrote:
> Hi,
>
> Looking for a one-liner to delete all empty elements in an array. I
> know I can do it with a foreach loop, but I'm hoping that I've missed
> an existing function in the manual which may already do this, or a
> simple one-line
8 matches
Mail list logo