note 37215 added to function.key
| From: | fontajos at phpeppershop dot com | Date: | Thu, 06 Nov 2003 21:16:41 +0000 |
| Subject: | note 37215 added to function.key | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-60027@lists.php.net to get a copy of this message | ||
/**
* Function delArrayElementByKey
*
* Deletes an arbitrary element in the given array $array_with_elements.
* The element which will be deleted is referenced by the array key $key_name.
*
* @param array $array_with_elements
* @param string $key_name
* @return array array without element referenced by $key_name
*/
function delArrayElementByKey($array_with_elements, $key_name) {
$key_index = array_keys(array_keys($array_with_elements), $key_name);
array_splice($array_with_elements, $key_index[0], 1);
return $array_with_elements;
}// End function delArrayElementByKey
----
Manual Page -- http://www.php.net/manual/en/function.key.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37215
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37215&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37215&report=yes
Search -- http://master.php.net/manage/user-notes.php