note 51932 added to function.array-splice
| From: | fontajos at phpeppershop dot com | Date: | Fri, 15 Apr 2005 14:48:01 +0000 |
| Subject: | note 51932 added to function.array-splice | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88060@lists.php.net to get a copy of this message | ||
<?php
// This function deletes a element in an array, by giving it the name of a key.
function delArrayElementByKey($array_with_elements, $key_name) {
$key_index = array_keys(array_keys($array_with_elements), $key_name);
if (count($key_index) != '') {
// Es gibt dieses Element (mindestens einmal) in diesem Array, wir loeschen es:
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.array-splice.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51932
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51932&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51932&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51932&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51932&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51932&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51932&report=yes
Search -- http://master.php.net/manage/user-notes.php