I've got a form which submits data to a csv file. When a user inputs a comma to a field, it destroys my csv structure. I want to convert inputted commas so that they can get displayed as a character.
I tried this:
$_POST["field"] = str_replace(",", "','", $_POST["field"]);
Use html encoding for instant relief , but still my recommendation to use phpExcel
$comma=",";
$_POST["field"] = str_replace(",", $comma, $_POST["field"]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With