note 122008 added to function.array-diff

From: Date: Mon, 11 Dec 2017 12:04:31 +0000
Subject: note 122008 added to function.array-diff
Groups: php.notes 
Request: Send a blank email to php-notes+get-209350@lists.php.net to get a copy of this message
If duplicate value comes in the first array, that will be also included. See in the output "blue" comes twice. <?php $array1 = array("a" => "green", "red", "blue", "red", "blue"); $array2 = array("b" => "green", "yellow", "red"); $result = array_diff($array1, $array2); print_r($result); //Output //Array ( [1] => blue [3] => blue ) ---- Server IP: 208.43.231.9 Probable Submitter: 182.73.163.98 ---- Manual Page -- http://php.net/manual/en/function.array-diff.php Edit -- https://master.php.net/note/edit/122008 Del: integrated -- https://master.php.net/note/delete/122008/integrated Del: useless -- https://master.php.net/note/delete/122008/useless Del: bad code -- https://master.php.net/note/delete/122008/bad+code Del: spam -- https://master.php.net/note/delete/122008/spam Del: non-english -- https://master.php.net/note/delete/122008/non-english Del: in docs -- https://master.php.net/note/delete/122008/in+docs Del: other reasons-- https://master.php.net/note/delete/122008 Reject -- https://master.php.net/note/reject/122008 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#209350) next »