note 112116 deleted from function.array-pop by googleguy
| From: | googleguy@php.net | Date: | Mon, 06 May 2013 19:17:34 +0000 |
| Subject: | note 112116 deleted from function.array-pop by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-194718@lists.php.net to get a copy of this message | ||
Note Submitter: Lucas Borges
----
You can easily delete a element from a array and recalculate its indexes this way:
<?php
function deleteAndReindexKeys($array, $key){
unset($array[$key]);
$result = array_merge($array);
return $result;
}
?>