PHP - Remove all non-numeric characters

/ Published in: PHP
Save to your folder(s)

Sometimes it’s helpful to ONLY get numeric characters.
Phone numbers, age — whatever your little PHP heart desires.

Copy this code and paste it in your HTML
  1. $strNumeric = preg_replace('/\D/', '', $strNonNumeric);


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.