Re: Re: unset empty elements in an array
| From: | Curt Zirzow | Date: | Mon, 12 Jul 2004 18:18:20 +0000 |
| Subject: | Re: Re: unset empty elements in an array | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190267@lists.php.net to get a copy of this message | ||
* 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
> in a "one liner" too:
>
> foreach ($in as $k => $v ) { $in[$k] = myFunction($v); }
>
> ... but someone decided it was useful as an internal function. 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.
The problem with your function you want is that it is very
specific, the name would have to be something like:
unset_array_items_only_if_val_is_empty($array);
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!