note 41914 deleted from function.array-keys by nlopess

From: Date: Mon, 26 Apr 2004 13:07:15 +0000
Subject: note 41914 deleted from function.array-keys by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-68817@lists.php.net to get a copy of this message
Note Submitter: the hammons ---- Heh... I'm slapping my forehead for this one, but just in case it gets anyone else... You don't just run the function on an array and then expect that array to be re-indexed. For some reason I was expecting this to happen even though I've been working with PHP for several years (This is the first time I've had to use this function). What you need to do is assign it to a new variable which then becomse the re-indexed array. eg: $new_array = array_values( $old_array ); :)

« previous php.notes (#68817) next »