I have csv file, i am reading data from it, i have join all which are randomly matching their rows like brands, customer and soon..,
Here i want to remove all duplicate from multi dimensional array which already in array
Here you can see how all duplicate values are appending to array in this image
Here is my php code
$csv = array_map('str_getcsv', file('test.csv'));
//echo '<pre>';
//print_r($csv);
//exit;
$brand =[];
foreach ($csv as $key => $value) {
if(!(in_array($value[14], $brand))){
$brand[$value[21]]['brands'][]=$value[14];
$brand[$value[21]]['products'][]=$value[1];
}
}
echo '<pre>';
print_r($brand);
Thanks and welcome for all suggestions