Posted By

alexd2 on 02/28/11


Tagged

movilphpvalidar movil


Versions (?)

Validar Movil


 / Published in: PHP
 

Validar móviles que empiezan con 6 y 7

  1. #-##########################
  2. # Espero les sirva :D AlexD2
  3. #-##########################
  4.  
  5. function valida_movil($movil=''){
  6. if(strlen(trim($movil)) == 0)
  7. return 0;
  8. $tmp = substr($movil,0,1);
  9. if($tmp == 6 || $tmp ==7){
  10. if(preg_match('/^[0-9]{9}$/',$movil))
  11. return 1;
  12. else
  13. return 0;
  14. }
  15. else{
  16. return 0;
  17. }
  18. }

Report this snippet  

You need to login to post a comment.