note 72294 added to function.array-slice
| From: | wgilk*at*reliablesites*dot*com at osu1 dot php dot net | Date: | Thu, 11 Jan 2007 21:00:17 +0000 |
| Subject: | note 72294 added to function.array-slice | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121563@lists.php.net to get a copy of this message | ||
<?php
function array_remove ($key, &$array) {
if (! isset ($array[$key])) return false;
$return = $array[$key];
unset ($array[$key]);
return $return;
}
?>
I thought maybe it would be useful to anyone looking for a simple way to slice a single element off
an associative array.
----
Server IP: 64.71.164.2
Probable Submitter: 70.91.177.61
----
Manual Page -- http://www.php.net/manual/en/function.array-slice.php
Edit -- https://master.php.net/note/edit/72294
Del: integrated -- https://master.php.net/note/delete/72294/integrated
Del: useless -- https://master.php.net/note/delete/72294/useless
Del: bad code -- https://master.php.net/note/delete/72294/bad+code
Del: spam -- https://master.php.net/note/delete/72294/spam
Del: non-english -- https://master.php.net/note/delete/72294/non-english
Del: in docs -- https://master.php.net/note/delete/72294/in+docs
Del: other reasons-- https://master.php.net/note/delete/72294
Reject -- https://master.php.net/note/reject/72294
Search -- https://master.php.net/manage/user-notes.php