Page 1 of 1

array_diff

Posted: Sat Apr 29, 2006 11:02 pm
by alex.barylski
I have two arrays which I want checked, both when passed to print_r() return:

Code: Select all

Array ( [0] => fname [1] => lname [2] => time ) 
Array ( [0] => fname [1] => lname [2] => time )
Identical in everyway...

but when I pass both arrays to array_diff() I get this:

Code: Select all

Array ( [1] => lname [2] => time )
WTF...

If both arrays are identical...should this function return an array of ZERO length???

What the hell am I missing...?

Code: Select all

print_r(array_diff($arr1, $arr2));
Cheers :)

Posted: Sat Apr 29, 2006 11:10 pm
by alex.barylski
Nevermind, I figured it out :oops:

Damn whitespace...drives me nutts :)