➤ This function compares the values of two (or more) arrays, and return an array that contains the entries from array1 that are not present in array2 or array3, etc. Syntax:
array_diff(array1, array2, array3, ...)
For instance:
$array1 = ["A" => 10, "B" => 20, "C" => 30, "D" => 40];
$array2 = ["A" => 10, "B" => 20, "C" => 30];
$result_array = array_diff($array1,$array2);
print_r ($result_array);
// outputs :  [D] => 40
by Levani Makhareishvili
2 years ago
PHP
Function
1
Pro tip: use ```triple backticks around text``` to write in code fences