Original answer
You can use str_getcsv()this because it is specifically designed for CSV process lines:
$out = array();
$array = str_getcsv($csv_input);
foreach($array as $item) {
$out[] = str_replace(',', '', $item);
}
$out now it is an array of elements without any commas in them, which you can simply explode, since the quotation marks will no longer be needed after removing the commas:
$revised_input = implode(',', $out);
Comment update
, :
$revised_input = '"' . implode('","', $out) . '"';
str_putcsv() ( PHP) , , .