Link to home
Create AccountLog in
Avatar of GameConsoleRepairCentreUK
GameConsoleRepairCentreUK

asked on

PHP - How to strip special characters from a string, but leave the dots?

I have this code:

$repairprice = preg_replace("/[^a-zA-Z0-9s]/", "", $repairprice);

Open in new window


This strips all special characters from the string. How strip all special character APART from dots (.) ?
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of GameConsoleRepairCentreUK
GameConsoleRepairCentreUK

ASKER

Thanks!