Re: [PHP4BETA] Re: [PHP3] howto remove key/value from array based on regexp
| From: | Andrei Zmievski | Date: | Tue, 11 Apr 2000 15:37:26 +0000 |
| Subject: | Re: [PHP4BETA] Re: [PHP3] howto remove key/value from array based on regexp | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-13390@lists.php.net to get a copy of this message | ||
On Tue, 11 Apr 2000, Rossi Designs wrote:
> loop through putting them into another array and don't pass the empty ones.
>
> for ($x=0;$x<count($array);$x++) {
> if ($array[$x] meets whatever condition) $array2[] = $array[$x];
> }
>
> Then if you need to you can pass them back to the original array
I hope to do a modification to preg_grep() which will make this much
easier.
-Andrei
* Non-volatile, random-access, analog memory store... a book. *