array_diff understanding

Hi there,

I must be misunderstanding the functionality of array_diff… here are two var_dump’s of two arrays I am looking to compare:


array(1) {
  [0]=>
  string(2) "41"
}
array(2) {
  [0]=>
  string(2) "41"
  [1]=>
  string(1) "9"
}

array_diff returns (whereby array(1) is the first argument and array(2) is the second argument in array_diff):


array(0) {
}

What? Why? Shouldn’t the “9” entry be somewhere in the array_diff returned array?

I’ve tried array_diff_assoc and array_diff_key and both return the same results.

array_diff() returns an array containing all the entries from the first array that are not present in any of the other arrays.