0

I am checking whether two arrays are identical and even though I know they are, my conditional returns false.

Here are the two arrays: http://pastebin.com/knekiW67

Here is the code:

$stored_items = (Array1 in Pastebin link)
$new_items = (Array2 in Pastebin link)

if($stored_items === $new_items) {
    return true;
} else {
    return false;
}

I've even checked the two arrays using https://www.diffchecker.com/ and it responds that they are identical.

Does anyone know why it's returning false?

Wikus
  • 65
  • 1
  • 9
  • I actually ended up using serialize() on the two arrays before comparing them which worked. – Wikus Nov 01 '16 at 10:27

1 Answers1

0

=== if not working for array(only string and int)

for checking array need use http://php.net/manual/ru/function.array-diff-ukey.php with special callback