another simple array question

From: Date: Fri, 18 Nov 2005 14:02:13 +0000
Subject: another simple array question
Groups: php.general 
Request: Send a blank email to php-general+get-226042@lists.php.net to get a copy of this message
I have an array with indexes 0 to 4 and I want to delete an element of the array if the index is equals 4. I want to delete the variable key and value.. What is the best way to do so? foreach ($values as $key => $val){ if ($key == "0") { // } if ($key == "3") { // } if ($key == "4") { //delete value from array } } Thanks!!!!!

« previous php.general (#226042) next »