Home »
MCQs »
PHP MCQs
What is the difference between array_diff() and array_diff_assoc() functions?
113. What is the difference between array_diff() and array_diff_assoc() functions?
- array_diff() compares the values only while array_diff_assoc() compares the keys only
- array_diff() compares the values only while array_diff_assoc() compares the keys and values
- Both functions can be used to compare the values and keys
- None of the above
Answer: B) array_diff() compares the values only while array_diff_assoc() compares the keys and values
Explanation:
The difference between array_diff() and array_diff_assoc() functions is: The array_diff() compares the values only while array_diff_assoc() compares the keys and values.