I have an array like this:
Array
(
[0] => Array
(
[iataCity] => NRT
[nameCity] => Tokyo
)
[1] => Array
(
[iataCity] => MIA
[nameCity] => Miami
)
[2] => Array
(
[iataCity] => DFW
[nameCity] => Dallas
)
[3] => Array
(
[iataCity] => LAX
[nameCity] => Los Angeles
)
[4] => Array
(
[iataCity] => MIA
[nameCity] => Miami
)
)
Miami is repeated, the idea is that no city is repeated, I have tried with array_unique but it does not work.
I have used the following:
array_unique($flightScales, SORT_REGULAR);
array_unique($flightScales);
array_values(array_unique($flightScales));
Any other idea?
The detail is that you have an array of array (multidimensional), to eliminate a repeated element that in this case is an array, use the following: