Reindexing Arrays
| From: | Nathan Cassano | Date: | Thu, 15 Feb 2001 16:56:56 +0000 |
| Subject: | Reindexing Arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-39942@lists.php.net to get a copy of this message | ||
I have an array of search results which I am searching through and
unset()ing unwanted search results. My question is once I have unset a
result there is then a break in the numeric index and how do I stop this
from happening or reindex the results. Like this..
$results = array(0 => array(more elements...), 1 => array(bla bla...) , 2
=>array(....));
/* unset results index 1 */
unset($results[1]);
/*
Now the $results index is like this..
array(0 => array(more elements...), 2 =>array(....));
*/