Remove Non Numeric Characters


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



Copy this code and paste it in your HTML
  1. function remove_non_numeric($string)
  2. {
  3. return preg_replace('/\D/', '', $string)
  4. }
  5.  
  6. // OR
  7.  
  8. $result = ereg_replace( '[^0-9]+', '', $source );

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.