SyntaxFix
Write A Post
Hire A Developer
Questions
Try this:
preg_replace('/[^0-9]/', '', '604-619-5135');
preg_replace uses PCREs which generally start and end with a /.
/