I have an array like the one below, I need to check for duplicates within the multi-dimensional associative array. I don’t think that I really need to say much more, I’ve already tried array_unique and it happens to think things are duplicates when they clearly aren’t.
I’m looking to change this:
array(3) {
[1]=>
array(2) {
["itself"]=>
string(31) "New York"
["status"]=>
string(18) "great"
}
[2]=>
array(2) {
["itself"]=>
string(36) "New York"
["status"]=>
string(22) "great"
}
[3]=>
array(2) {
["itself"]=>
string(29) "New York"
["status"]=>
string(18) "great"
}
}
In to this:
array(1) {
[1]=>
array(2) {
["itself"]=>
string(31) "New York"
["status"]=>
string(18) "great"
}
}
Is this an actual output, because the string-lengths don’t match… Maybe some hidden data (html-tags, non-printable characters, etc.)?
If not: array_unique wants a string representation: