note 68179 added to function.array-intersect-key
| From: | php-general at lists dot php dot net | Date: | Mon, 17 Jul 2006 12:31:26 +0000 |
| Subject: | note 68179 added to function.array-intersect-key | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-114842@lists.php.net to get a copy of this message | ||
Here it is a more obvious way to implement the function:
if (!function_exists('array_intersect_key')) {
function array_intersect_key()
{
$arrs = func_get_args();
$result = array_shift($arrs);
foreach ($arrs as $array) {
foreach ($result as $key => $v) {
if (!array_key_exists($key, $array)) {
unset($result[$key]);
}
}
}
return $result;
}
}
----
Server IP: 195.222.164.18
Probable Submitter: 85.140.19.156
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.array-intersect-key.php
Edit -- http://master.php.net/note/edit/68179
Del: integrated -- http://master.php.net/note/delete/68179/integrated
Del: useless -- http://master.php.net/note/delete/68179/useless
Del: bad code -- http://master.php.net/note/delete/68179/bad+code
Del: spam -- http://master.php.net/note/delete/68179/spam
Del: non-english -- http://master.php.net/note/delete/68179/non-english
Del: in docs -- http://master.php.net/note/delete/68179/in+docs
Del: other reasons-- http://master.php.net/note/delete/68179
Reject -- http://master.php.net/note/reject/68179
Search -- http://master.php.net/manage/user-notes.php