<?php
$_POST['phone'] = "0912312312" ;
echo $_POST['phone']."<br>";
if(eregi("09[0-9]{8}",$_POST['phone']))
echo "ok<br>";
else
echo "no<br>";
$_POST['phone'] = "0912-312-312" ;
echo $_POST['phone']."<br>";
if(eregi("09[0-9]{2}-[0-9]{3}-[0-9]{3}",$_POST['phone']))
echo "ok<br>";
else
echo "no<br>";
$_POST['phone'] = "0912-312312" ;
echo $_POST['phone']."<br>";
if(eregi("09[0-9]{2}-[0-9]{6}",$_POST['phone']))
echo "ok<br>";
else
echo "no<br>";
?>
沒有留言:
張貼留言