note 128654 added to function.array-diff-uassoc
| From: | pradeep at main dot php dot net | Date: | Sat, 01 Jul 2023 08:32:43 +0000 |
| Subject: | note 128654 added to function.array-diff-uassoc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220614@lists.php.net to get a copy of this message | ||
<?php
function key_compare_func($a, $b)
{
if ($a === $b) {
return 0;
}
return ($a > $b)? 1:-1;
}
$array1 = array("a" => "green", "b" => "brown",
"c" => "blue", "red");
$array2 = array("a" => "green", "yellow", "red");
$result = array_diff_uassoc($array2, $array1, "key_compare_func");
print_r($result);
?>
//output will be
Array
(
[1] => yellow
)
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.168 (proxied: 49.205.197.98)
----
Manual Page -- https://php.net/manual/en/function.array-diff-uassoc.php
Edit -- https://main.php.net/note/edit/128654
Del: integrated -- https://main.php.net/note/delete/128654/integrated
Del: useless -- https://main.php.net/note/delete/128654/useless
Del: bad code -- https://main.php.net/note/delete/128654/bad+code
Del: spam -- https://main.php.net/note/delete/128654/spam
Del: non-english -- https://main.php.net/note/delete/128654/non-english
Del: in docs -- https://main.php.net/note/delete/128654/in+docs
Del: other reasons-- https://main.php.net/note/delete/128654
Reject -- https://main.php.net/note/reject/128654
Search -- https://main.php.net/manage/user-notes.php