note 35755 deleted from function.unset by vincent
| From: | vincent@php.net | Date: | Sat, 13 Sep 2003 08:32:33 +0000 |
| Subject: | note 35755 deleted from function.unset by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56434@lists.php.net to get a copy of this message | ||
Note Submitter: Amon-Jack@csa-corp.com
----
[QUOTE]
function deleteKey($array, $keyname, $value)
{
end($array);
$last = key($array);
for($i=0; $i<=$last; $i++)
{
if($array[$i][$keyname] == $value)
{
unset($array[$i]);
}
}
$newArray = array_values( $array );
return $newArray;
}
[/QUOTE]
Why working so complex?
unset($array[$keyname]) is still the same.