note 119508 added to function.array-slice
| From: | SomeGuy | Date: | Fri, 24 Jun 2016 09:17:35 +0000 |
| Subject: | note 119508 added to function.array-slice | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-205805@lists.php.net to get a copy of this message | ||
Thank to taylorbarstow here the function with the unset feature.
<?php
function array_slice_assoc(&$array,$keys,$unset = true) {
$return = array_intersect_key($array, array_flip($keys));
if ($unset) {
foreach ($keys as $value) {
unset($array[$value]);
}
}
return $return;
}
?>
----
Server IP: 72.52.91.14
Probable Submitter: 80.12.102.146
----
Manual Page -- http://php.net/manual/en/function.array-slice.php
Edit -- https://master.php.net/note/edit/119508
Del: integrated -- https://master.php.net/note/delete/119508/integrated
Del: useless -- https://master.php.net/note/delete/119508/useless
Del: bad code -- https://master.php.net/note/delete/119508/bad+code
Del: spam -- https://master.php.net/note/delete/119508/spam
Del: non-english -- https://master.php.net/note/delete/119508/non-english
Del: in docs -- https://master.php.net/note/delete/119508/in+docs
Del: other reasons-- https://master.php.net/note/delete/119508
Reject -- https://master.php.net/note/reject/119508
Search -- https://master.php.net/manage/user-notes.php