Let's say I want to do this:
$a = array_intersect_assoc( array( 'key1' => array( 'key2' => 'value2' ), 'key3' => 'value3', 'key4' => 'value4' ), array( 'key1' => array( 'key2' => 'some value not in the first parameter' ), 'key3' => 'another value' ) ); var_dump( $a );
The printed result is:
array 'key1' => array 'key2' => string 'value2' (length=6)
It's clear that values associated with 'key2' in both arrays are not the same, however array_intersect_assoc()
still return 'key2' => 'value2'
as the intersected value.
Is this the expected behavior of array_intersect_assoc()
?
Thanks!