php 手机号判断问题

来源:互联网 发布:php培训招聘 编辑:程序博客网 时间:2024/04/28 14:20

  if (empty($_POST['tel']))
  {
   $this->error("手机不能为空!");
  }
  if(strlen($_POST['tel']) != 11){
   $this->error("手机号必须是11位!");
  }
  if(!is_numeric($_POST['tel'])){
   $this->error("手机号必须是数字!");
  }
0 0
原创粉丝点击