Re: [PHP] Removing empty array values.

2003-08-18 Thread Tom Rogers
Hi, Monday, August 18, 2003, 10:03:25 PM, you wrote: z How do I remove empty array values? z -- z - Zavaboy z [EMAIL PROTECTED] z www.zavaboy.com In a loop with unset() foreach($array as $key=$val){ if(empty($val) unset($array[$key]); } -- regards, Tom -- PHP General Mailing List

Re: [PHP] Removing empty array values.

2003-08-18 Thread David Otton
On Mon, 18 Aug 2003 08:03:25 -0400, you wrote: How do I remove empty array values? That could mean a lot of things. I'm going to assume you have a simple indexed array and want to remove any entries where array[index] == FALSE, and reindex the array. The most elegant way is to copy all the

RE: [PHP] Removing empty array values.

2003-08-18 Thread Johnson, Kirk
On Mon, 18 Aug 2003 08:03:25 -0400, you wrote: How do I remove empty array values? This will remove the empty values and re-index the array so there are no holes. $new_array = array_values($old_array); Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Removing empty array values.

2003-08-18 Thread Curt Zirzow
* Thus wrote Johnson, Kirk ([EMAIL PROTECTED]): On Mon, 18 Aug 2003 08:03:25 -0400, you wrote: How do I remove empty array values? This will remove the empty values and re-index the array so there are no holes. $new_array = array_values($old_array); I wouldn't suggest this, it