I use the following code to get data from a form and save it as csv.
$cvsData = $name . "," . $address . "\n";
$fp = fopen("file.csv", "a");
if ($fp) {
fwrite($fp, $cvsData); // Write information to the file
fclose($fp); // Close the file
}
When someone enters a comma or line break in address field it breaks the formatting. So how can i escape it so that the whole address stays in the same field ?