note 32826 added to function.array-pop

From: Date: Sun, 08 Jun 2003 11:10:26 +0000
Subject: note 32826 added to function.array-pop
Groups: php.notes 
Request: Send a blank email to php-notes+get-49975@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... 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. ---- Manual Page -- http://www.php.net/manual/en/function.array-pop.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32826 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32826&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32826&report=yes

« previous php.notes (#49975) next »