note 20874 deleted from control-structures.foreach by vincent

From: Date: Thu, 30 Oct 2003 07:14:46 +0000
Subject: note 20874 deleted from control-structures.foreach by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-59513@lists.php.net to get a copy of this message
Note Submitter: saden1@yahoo.com ---- Best way I know of to remove an element from an array and have everything shift automatically is: $arr= array(9,8,7,6,5,4,3,2,1); $remove_index = 1; array_splice($arr, $remove_index, array_slice($arr, $remove_index +1)); You’d thing there would be a function that does this automatically. If there is a better way then please let me know at: mad_d_man@yahoo.com

« previous php.notes (#59513) next »