Why array_diff() compares two different arrays as same and returns empty result? [closed]
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have this code: $a1 = array(31001); $a2 = array(31001, 31002); $diff = array_diff($a1, $a2); var_dump($diff); I was expecting that array_diff will return array(0 => 31002) according to PHP documentation: