Posted By


jspicher on 10/09/09

Tagged


Statistics


Viewed 581 times
Favorited by 0 user(s)

string_to_number($string)


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

Convert a string to number.


Copy this code and paste it in your HTML
  1. function string_to_number($string){
  2. $string = preg_replace('/[\'"]/', '', $string);
  3. $string = preg_replace('/[^0-9]+/', '', $string);
  4. $string = trim($string, '');
  5. $string = strtolower($string);
  6. return $string;}

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.