Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1.         /**
  2.          * le numéro de téléphone commence t-il par 06 ou 07 ?
  3.          * @param type $telephone
  4.          * @return boolean
  5.          */
  6.         public static function isTelephonePortable($telephone){
  7.             if(filter_var((int)$telephone, FILTER_VALIDATE_INT) === false){
  8.                 return false;
  9.             }
  10.  
  11.             if(substr($telephone, 0, 2) === '06' || substr($telephone, 0, 2) === '07'){
  12.                 return true;
  13.             }
  14.             return false;
  15.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement