I am importing a csv file with php League peckage, on import it prepends a character b outside the double quotes of string and this breaks the MySQL query for that column.
I have tried rtrim and str_replace but none of that helps
$csv = Reader::createFromPath($data, 'r');
$header = $csv->fetchone();
$stations = $csv->setOffSet(1)->fetchAssoc($header);
I expect the output as following
array:1 [
0 => array:9 [
"station_name" => "HASAN KARACA - - N KOLAY BRANCH"
"phone" => "123456"
]
]
But the actual out is
array:1 [
0 => array:9 [
"station_name" => b"HASAN KARACA - - N KOLAY BRANCH"
"phone" => "123456"
]
]
Please note there is b in station_name which shouldn't be there.