hi all, i need help on filtering my 2 dimensional array such as example below:
array(29) {
[0]=> array(2) {
[0]=> string(16) "Andorra La Vella"
[1]=> string(2) "AD"
}
[1]=> array(2) {
[0]=> string(16) "Andorra La Vella"
[1]=> string(2) "AD"
}
[2]=> array(2) {
[0]=> string(16) "Andorra La Vella"
[1]=> string(2) "AD"
}
[3]=> array(2) {
[0]=> string(16) "Andorra La Vella"
[1]=> string(2) "AD"
}
[4]=> array(2) {
[0]=> string(12) "Les Escaldes"
[1]=> string(2) "AD"
}...
how do i filter any redundant value from my array? such as key[0] has the same value as key[1][2][3] and i want to remove this redundant value from my array.
i tried array_filter()
but no luck. i tried array_splice()
and unset()
, no luck in either one.
does php provides any native array function for this?
thanks,
aji