Blogger Information
Blog 65
fans 1
comment 1
visits 119013
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
正则验证手机号(199-198-166 )
技术宅的博客
Original
1072 people have browsed it
/**
 * 验证手机号
 * @param $phone
 * @return bool
 */
public function checkPhone($phone){
   // 验证手机号
   $preg_phone='/^0?(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/';
   if(preg_match($preg_phone,$phone)){
      return true;
   }else{
      return false;
   }
}


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post