compare two arrays and return the difference php

Solutions on MaxInterview for compare two arrays and return the difference php by the best coders in the world

showing results for - "compare two arrays and return the difference php"
Alan
24 Oct 2019
1
2<?php
3$array1 array("a" => "green""red""blue""red");
4$array2 array("b" => "green""yellow""red");
5$result = array_diff($array1$array2);
6
7print_r($result);
8?>
9
10Array
11(
12    [1] => blue
13)
Nicolò
16 Jan 2016
1array_merge(array_diff($array1,$array2),array_diff($array2,$array1))
2
queries leading to this page
get diff value between array php array difference phpcompare two arrays and show differences phpget diffence between to arrays phpphp compare arrays valuescheck difference between two array phparr diff in phpcompare two arrays in phpdifference between 2 arrays phpget diffrence between array php array diffcheck array difference phpphp array compare left array diff in phpphp arrays differenceget difference element in two arrays php array diff phpfind difference between arrays in phpphp 2 array differencephp difference between two arraysphp array diffhow to compare arrays in phpphp difference between two arrays valuescompare between two arrays phphow to take differnce between two array in phpphp array value differencesget the difference between array phpphp compare difference between two arrayget difference between two arrays phpcompare array values in phpdifference between two array phpphp array differencephp compare arraytwo array difference in phpphp compare 2 arraysphp compare arrayscompare array and get diff phpphp array comparephp array diffphp check diference between arraysphp difference between 2 arraysarray diff phpphp array one minus array 2compared 2 arrays and bring difference phpcompare 2 arrays valuercompare between 2 arrays phpphp compare values in arraycompare difference from two phpphp array subtractarray difference in phparray 1 minus array 2 in phpcompare two array in phpget difference between two array phpphp get array differencephp get differences in 2 arraysphp 2 arrays find differencesphp compare array get bothphp compare arry if both are same or notphp get difference between two arraysphp two arrays differencefind difference between two arrays phpcompare two arrays and return the difference phparray difference in phpcompare two arrays phpcompare two array values in phpcheck data between two arrays phpcompare two arrays and get the difference phphow to compare two different arrays in phpphp compare values in two arraysphp array difference between two arraysphp compare arrays find differencesget difference between two array of phpget defrint value in tow array phpget array difference phpphp compare two arrays and show differencesget the difference between two arrays phparray diff only value phpcheck diff of two arrays phparray diffcompare two arrays and return the difference php