SheppardDigital
asked on
PHP preg_replace
Hi,
I currently have this line of code which cleans a string. Could someone tell me how I would change this to allow the minus sign (-)?
$string = preg_replace("/[^a-zA-Z0-9 s]/", "", $string);
Thanks
I currently have this line of code which cleans a string. Could someone tell me how I would change this to allow the minus sign (-)?
$string = preg_replace("/[^a-zA-Z0-9
Thanks
$string = preg_replace("/[^a-zA-Z0-9s\-]/", "", $string);
Ooops, I was confused! :-(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
$string = preg_replace("/[^a-zA-Z0-9s\-]/", "", $string);
$string = preg_replace("/[^a-zA-Z0-9
Cheers