note 71978 deleted from function.array by nlopess
| From: | nlopess@php.net | Date: | Wed, 27 Dec 2006 17:05:00 +0000 |
| Subject: | note 71978 deleted from function.array by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-120958@lists.php.net to get a copy of this message | ||
Note Submitter: jeswanth at gmail dot com
----
Hi all,
I thought this small piece of code can help you in your coding. If you ever deleted an element in an
array and want to re-construct the array and want to have the keys in series ie from starting 0 till
end, use array_values.
$temp=array('1', 3 => '2', 4 => '3');
print_r($temp);
$temp=array_values($temp);
print_r($temp);
Hope this helps :)