note 59335 deleted from function.array-splice by felipe

From: Date: Sat, 05 Jan 2008 02:06:24 +0000
Subject: note 59335 deleted from function.array-splice by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-134823@lists.php.net to get a copy of this message
Note Submitter: Julien PACHET ---- If you want to remove an item of the array, shifting the others values, you can use: function my_array_unset($array,$index) { // unset $array[$index], shifting others values $res=array(); $i=0; foreach ($array as $item) { if ($i!=$index) $res[]=$item; $i++; } return $res; }

« previous php.notes (#134823) next »