$string = 'ab!:;c+12,.3 €def-x/';
$string = preg_replace('/[^a-zA-Z0-9\s€+-]+/', '', $string);
$val=htmlentities($string, ENT_NOQUOTES, );
echo $string,"
";
Echos
abc+123 �def-x
And not
abc+123 €def-x
I need to get the Euro symbol through a Regex and into the database but not as the Euro symbol.