There is a possibility that array_unique
take the elements you want from an array, for example, we have an array with keys and names, and we want to eliminate duplicate names by ignoring keys that may be different.
I know there is no point in doing this but I could not think of another example
That is, if we have an array with this data
1000 Mortadelo Garcia
1001 Filemon Fernandez
1002 Eduardo ManosTijeras
1003 Filemon Fernandez
If we would use array_unique
with this data we would return the same array since the id changes, but if the id would be ignored, this array would remain
1000 Mortadelo Garcia
1001 Filemon Fernandez
1002 Eduardo ManosTijeras
I'm even interested in the possibility that this can be done:
1000 Mortadelo Garcia
1001,1003 Filemon Fernandez
1002 Eduardo ManosTijeras
Maybe array_unique
does not have these possibilities and simply compares all the data in the array. So the next question comes up, how could you make these comparisons.