all
I want to remove the duplicate value from this Array
Array
(
[0] => Array
(
[0] => Ajay Patel
[1] => Tag 1
)
[1] => Array
(
[0] => Tag 1
[1] => Tag 3
)
[2] => Array
(
)
[3] => Array
(
)
[4] => Array
(
)
)
I tried this solution from How to remove duplicate values from a multi-dimensional array in PHP
$result2 = array_map("unserialize", array_unique(array_map("serialize", $result2)));
But i think something is wrong here, i am getting this as result.
Array
(
[0] => Array
(
[0] => Ajay Patel
[1] => Tag 1
)
[1] => Array
(
[0] => Tag 1
[1] => Tag 3
)
[2] => Array
(
)
)
What i want is
Array
(
[0] => Ajay Patel
[1] => Tag 1
[2] => Tag 3
)
Tag 1 is removed because its 2 times...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…