php array_diff () function syntax
Effect: Comparison of two arrays of keys, and returns the set difference. Marble platform price list
语法:array_diff(array1,array2,array3...)
parameter:
parameter | description |
array1 | essential. Were the first array to be compared with other arrays. |
array2 | essential. An array to be compared with the first array. |
array3, ... | Optional. Other arrays were compared with the first array. |
Description: Returns the difference between two arrays of arrays. The array contains all the array being compared, but not in any other key parameters in the array. In the returned array, the keys remain unchanged.
php array_diff () function examples
<? PHP $ Class1 = Array ( "Simon" => "55", "extinction" => "44", "wild" => "22 is"); $ Class2 = Array ( "Simon" => "54" "extinction" => "44", "wild" => "25"); print_r (array_diff ($ class1, $ Class2)); // returns two different elements in the array ?>