I have an array which contains multiple of the same data:
array(2) {
[0]=>
array(2) {
["id"]=>
string(11) "43000173601"
["data"]=>
array(2) {
[0]=>
array(2) {
["id"]=>
string(5) "52874"
["name"]=>
string(3) "x70"
}
[1]=>
array(2) {
["id"]=>
string(5) "52874"
["name"]=>
string(3) "x70"
}
}
}
[1]=>
array(2) {
["id"]=>
string(11) "43000173602"
["data"]=>
array(1) {
[0]=>
array(2) {
["id"]=>
string(5) "52874"
["name"]=>
string(3) "x70"
}
}
}
}
I have tried using array_unique() to remove these entries, but receive this error:
Array to string conversion
The outer arrays contain route ID's, some busses may have 2 different routes so in this case, they can stay however, I just want to remove the dupe entries inside the 1 route:
[0]=>
array(2) {
["id"]=>
string(11) "43000173601"
["data"]=>
array(2) {
[0]=>
array(2) {
["id"]=>
string(5) "52874"
["name"]=>
string(3) "x70"
}
[1]=>
array(2) {
["id"]=>
string(5) "52874"
["name"]=>
string(3) "x70"
}
}
var_exportand notprint_rthe ones from var export are usable in code, the ones from print_r are human readable, so to use it one has to fix it first, where as var export can just be pasted and worked with. I'd help you but I'm to lazy to fix it. One day I will make a print_r converter ...