Array
(
[0] => Array
(
[0] => abc
[1] => def
)
[1] => Array
(
[0] => ghi
[1] => jkl
)
[2] => Array
(
[0] => mno
[1] => pql
)
[3] => Array
(
[0] => abc
[1] => def
)
[4] => Array
(
[0] => ghi
[1] => jkl
)
[5] => Array
(
[0] => mno
[1] => pql
)
)
Asked
Active
Viewed 75 times
-9

Bharat
- 2,441
- 3
- 24
- 36

Swati Tyagi
- 1
- 2
-
Copy Pasted the question. I mean what are you experimenting ? – jitendrapurohit Jan 17 '17 at 09:05
-
completely duplicate – Beginner Jan 17 '17 at 09:05
-
A duplicate question about duplicate values is funny, but this isn't a comedy site. – apokryfos Jan 17 '17 at 09:12
3 Answers
0
Would use a nested foreach like follows:
foreach ($aArray as $iPos => $aInnerArray) {
foreach ($aArray as $iPos => $aArrayToCheck) {
if($aInnerArray === $aArrayToCheck){
unset($aArray($iPos));
}
}
}

atoms
- 2,993
- 2
- 22
- 43
0
Try this code
//method for remove duplicate data
function removeDuplicate($arr) {
//Define output
$outputs = [];
//Define temp for keep data
$tmps = [];
foreach ($arr as $each) {
//convert to string
$tmp = implode("|", $each);
if (!in_array($tmp, $tmps)) {
$tmps[] = $tmp;
$outputs[] = $each;
}
}
return $outputs;
}

Akkapong Kajornwongwattana
- 513
- 5
- 9