Removing empty values from array
| From: | Martin Scotta | Date: | Thu, 25 Jun 2009 20:52:07 +0000 |
| Subject: | Removing empty values from array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-294615@lists.php.net to get a copy of this message | ||
Hi all
I have this in a simple routine...
for($i=0, $if=count($array); $i<$if; ++$i)
if( $array[$i] == '' )
{
array_splice( $array, $i, 1);
--$i;
--$if;
}
My question: is this the better way to do it?
--
Martin Scotta