note 92115 added to function.array-diff
| From: | Anonymous at osu1 dot php dot net | Date: | Thu, 09 Jul 2009 11:45:57 +0000 |
| Subject: | note 92115 added to function.array-diff | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158100@lists.php.net to get a copy of this message | ||
I want to correct a small mistake in the example above:
<?php
$array1 = array("a" => "green", "red", "blue",
"red");
$array2 = array("b" => "green", "yellow", "red");
$result = array_diff($array1, $array2);
print_r($result);
?>
in this case the $result would equal to Array('green', 'blue');
<?php
$array1 = array("a" => "green", "red", "blue",
"yellow");
$array2 = array("b" => "green", "yellow", "red");
$result = array_diff($array1, $array2);
print_r($result);
?>
$result is Array("blue");
I assume the example meant the second case.
----
Server IP: 64.71.164.2
Probable Submitter: 81.83.245.140
----
Manual Page -- http://www.php.net/manual/en/function.array-diff.php
Edit -- https://master.php.net/note/edit/92115
Del: integrated -- https://master.php.net/note/delete/92115/integrated
Del: useless -- https://master.php.net/note/delete/92115/useless
Del: bad code -- https://master.php.net/note/delete/92115/bad+code
Del: spam -- https://master.php.net/note/delete/92115/spam
Del: non-english -- https://master.php.net/note/delete/92115/non-english
Del: in docs -- https://master.php.net/note/delete/92115/in+docs
Del: other reasons-- https://master.php.net/note/delete/92115
Reject -- https://master.php.net/note/reject/92115
Search -- https://master.php.net/manage/user-notes.php