note 32826 modified in function.array-pop by vrana
| From: | vrana@php.net | Date: | Tue, 17 Aug 2004 14:48:08 +0000 |
| Subject: | note 32826 modified in function.array-pop by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79820@lists.php.net to get a copy of this message | ||
A function that may help some out, considering it's pretty much the one mentioned previously...
<?php
function array_trim($arr, $indice) {
if(!isset($indice)) {
$indice = count($arr)-1;
}
unset($arr[$indice]);
array_shift($arr);
return $arr;
}
?>
It cuts the given index value off of the array, but without the shift, if the 'index'
value isn't given, it cuts off the end value.
--was--
A function that may help some out, considering it's pretty much the one mentioned previously...
function array_trim($arr, $indice) {
if(!isset($indice)) {
$indice = count($arr)-1;
}
unset($arr[$indice]);
array_shift($arr);
return $arr;
}
It cuts the given index value off of the array, but without the shift, if the 'index'
value isn't given, it cuts off the end value.
http://php.net/manual/en/function.array-pop.php