$tel='要验证的联系电话';

$isMob="/^1[3-5,8]{1}[0-9]{9}$/";
$isTel="/^([0-9]{3,4}-)?[0-9]{7,8}$/";
if(!preg_match($isMob,$tel) && !preg_match($isTel,$tel))
{
 exit("<script>alert('联系电话格式不正确!');window.history.go(-1);window.location.replace(document.referrer);</script>");
}

 

相关文章:

  • 2021-10-29
  • 2022-12-23
  • 2021-07-24
  • 2021-11-29
  • 2021-12-05
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
猜你喜欢
  • 2021-11-16
  • 2022-12-23
  • 2021-11-29
  • 2021-11-22
  • 2022-12-23
  • 2021-10-05
  • 2021-05-28
相关资源
相似解决方案