Thread: Compare arrays
View Single Post
  #3  
Old 08-30-2009, 09:38 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by cbk1994 View Post
I wonder if you could do something like

PHP Code:
if ((@ array1) == (@ array2)) {
  
// whatever

since @ converts arrays to strings. I know this works for some other stuff, such as "in" or "index".
That works, yes, but the problem is that the order of the array elements has to be the same as well. Could sort both of them before checking if they are equal though
Reply With Quote