* 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 removes all your index's (renaming them
to integers) plus it doesn't remove empty values.

$array = array ("size" => "XL", "color" => "gold", 'blah'=>'');
print_r(array_values ($array));

results:
Array
(
    [0] => XL
    [1] => gold
    [2] => 
)



Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to