note 74428 added to function.array-diff-assoc
| From: | contact at pascalopitz dot com | Date: | Wed, 11 Apr 2007 11:14:59 +0000 |
| Subject: | note 74428 added to function.array-diff-assoc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125281@lists.php.net to get a copy of this message | ||
The direction of the arguments does actually make a difference:
<?
$a = array(
'x' => 'x',
'y' => 'y',
'z' => 'z',
't' => 't',
);
$b = array(
'x' => 'x',
'y' => 'y',
'z' => 'z',
't' => 't',
'g' => 'g',
);
print_r(array_diff_assoc($a, $b));
print_r(array_diff_assoc($b, $a));
?>
echoes:
Array
(
)
Array
(
[g] => g
)
----
Server IP: 87.124.64.96
Probable Submitter: 87.194.35.152
----
Manual Page -- http://www.php.net/manual/en/function.array-diff-assoc.php
Edit -- https://master.php.net/note/edit/74428
Del: integrated -- https://master.php.net/note/delete/74428/integrated
Del: useless -- https://master.php.net/note/delete/74428/useless
Del: bad code -- https://master.php.net/note/delete/74428/bad+code
Del: spam -- https://master.php.net/note/delete/74428/spam
Del: non-english -- https://master.php.net/note/delete/74428/non-english
Del: in docs -- https://master.php.net/note/delete/74428/in+docs
Del: other reasons-- https://master.php.net/note/delete/74428
Reject -- https://master.php.net/note/reject/74428
Search -- https://master.php.net/manage/user-notes.php