I have a PHP Variable which i need to remove all special characters from, like % / é / !
etc
how can i replace all characters OTHER than A-Z
/ a-z
/ 0-9
and .
(full stop) with a _
I have a PHP Variable which i need to remove all special characters from, like % / é / !
etc
how can i replace all characters OTHER than A-Z
/ a-z
/ 0-9
and .
(full stop) with a _
Something like this ought to work.
preg_replace("/[^A-Za-z0-9\.]/", "_", $str);