$TELEPHONE = 0912345678 if(preg_match("/09[0-9]{2}[0-9]{6}/", $TELEPHONE)) { echo "正確"; }else{ echo "錯誤"; }