Your Ad Here

Posted By

nicolaspar on 07/12/06


Tagged

intval numeros


Versions (?)

Php solo Números


 / Published in: PHP
 

  1. function soloNumeros( $str ){
  2. #Funcion levantar(): http://snipplr.com/view/367/levantar-parmetro-beta-01/
  3. return eregi_replace("[^0-9]","", levantar( $str ) );
  4. }
  5. #Versi�³n sin levantar()
  6. function soloNumeros( $str ){
  7. return empty( $str ) ? false : eregi_replace("[^0-9]","", $str );
  8. }
  9. $numero = soloNumeros( 'oa09a98a..9898981.1' ) #Out 099898989811
  10.  
  11. //NEW VERSION
  12. function soloNum( $str ){
  13. return preg_replace("|[^0-9]|","", $str );
  14. }

Report this snippet  

You need to login to post a comment.