What is the purpose of using array_diff() in PHP and how does it work with multi-dimensional arrays?

The purpose of using array_diff() in PHP is to compare two arrays and return the values from the first array that are not present in any of the other arrays. When dealing with multi-dimensional arrays, array_diff() can be used to compare the values of the arrays at a deeper level.

// Example of using array_diff() with multi-dimensional arrays
$array1 = array(
    array('a', 'b'),
    array('c', 'd')
);

$array2 = array(
    array('a', 'b'),
    array('e', 'f')
);

$result = array_diff($array1, $array2);

print_r($result);