php4-beta | 200004

[PHP4BETA] Re: [PHP3] howto remove key/value from array based on regexp From: Rossi Designs (webmaster <email protected>)
Date: 04/11/00

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

Rossi Designs
PO Box 1084
Holly Hill, FL 32125-1084
Phone : (904) 226-8979
URL : http://rossidesigns.net
----- Original Message -----
From: Dan Larsson <dl <email protected>>
To: Php4beta (E-mail) <php4beta <email protected>>; [PHP-Users-List] (E-mail)
<php3 <email protected>>
Sent: Tuesday, April 11, 2000 11:00 AM
Subject: [PHP3] howto remove key/value from array based on regexp

| My aim is to remove any keys where the values contain nothing but
| spaces and/or newlines from an array.
|
| $array[0] = '123';
| $array[1] = ' ';
| $array[2] = 'abc';
|
| so that the above array becomes
|
| $array[0] = '123';
| $array[1] = 'abc';
|
| Any ideas?
|
| Regards
| ------------
| Dan Larsson
|
|
| --
| PHP 3 Mailing List <http://www.php.net/>
| To unsubscribe, send an empty message to php3-unsubscribe <email protected>
| To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
| To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
| To contact the list administrators, e-mail: php-list-admin <email protected>
|
|

-- 
PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
To unsubscribe, e-mail: php4beta-unsubscribe <email protected>
For additional commands, e-mail: php4beta-help <email protected>
To contact the list administrators, e-mail: php4beta-admin <email protected>