When exporting data from mysqladmin to MSExcel, the presence of any commas etc breaks the excel spreadsheet.
This was my first function I ever wrote to clean out the damaging characters from the input form.
I was just wondering if php already has a built-in function for this or if there is a more elegant way of writing this or is this even the right approach.
Please don't laugh too hard..! 🙂
Function strips
,@;\n\r'"\
from input
function stripper($data)
{
$filename2 = str_replace(",", "", "$data");
$filename3 = str_replace("@", "", "$filename2");
$filename4 = str_replace(";", "", "$filename3");
$filename5 = str_replace("'", "", "$filename4");
$filename6 = str_replace('"', "", "$filename5");
$filename7 = str_replace("\r", " ", "$filename6");
$filename9 = htmlspecialchars ($filename8 = str_replace("\n", "", "$filename7"));
$filename10 = stripslashes($filename9);
return $filename10;
}