I'm trying to delete duplicate arrays.. but it seems not to work...
this is my array:
array
(
[1] => Array
(
[id] => 141
[yt] => 5
[PHD] => Jan
[type] => Mercedes
[aid] => 5
)
[2] => Array
(
[id] => 2
[yt] => 5
[PHD] => Jan
[type] => Mercedes
[aid] => 5
)
[3] => Array
(
[id] => 3
[yt] => 5
[PHD] => Jan
[type] => Mercedes
[aid] => 5
)
[4] => Array
(
[id] => 10
[yt] => 5
[PHD] => Jan
[type] => Mercedes
[aid] => 5
)
[5] => Array
(
[id] => 4
[yt] => 5
[PHD] => Peter
[type] => Audi
[aid] => 5
)
)
OUTPUT
[5] => Array
(
[id] => 4
[yt] => 5
[PHD] => Peter
[type] => Audi
[aid] => 5
)
The array creates with a SQL query so I foreach the array:
foreach($All_cars as $key=>$row) {
.....
print_r($All_cars);
}
So that outputs the whole array.
I tried this but no effect.
$result = array_unique($All_cars );
I hope you guys can help me... cause I tried this 1 whole day already.
Thanks for your help.