I’m trying to use ereg_replace() to only allow Upper and lower letters and, and spaces since I will be exploding it using commas.
I have this code below but it’s removing the spaces and I can figure out how to allow , to pass through.
$type = ereg_replace("[^A-Za-z\.-:/-]", "", $string);
Also I know ereg_replace() is deprecated but this is the closes I have gotten.
Use the following
That will allow A-Z, a-z, commas and spaces and remove everything else.
NB. Everything else includes accented characters etc.