Posted By

chopbust on 07/18/11


Tagged


Versions (?)

Extract Numbers from String


 / Published in: PHP
 

Give a string, and it will only returns numbers.

  1. function extract_number($string) {
  2. return ereg_replace("[^0-9]", "", $string);
  3. }

Report this snippet  

You need to login to post a comment.