メールフォームで電話番号の正規表現(関数式)
function check_tel($str) {
if(preg_match("/^(0(?:[1-9]|[1-9]{2}\d{0,2}))-([2-9]\d{0,3})-(\d{4})$/" , $str)) {
return true;
} else {
return false;
}
}
メールフォームで電話番号の正規表現(関数式)
function check_tel($str) {
if(preg_match("/^(0(?:[1-9]|[1-9]{2}\d{0,2}))-([2-9]\d{0,3})-(\d{4})$/" , $str)) {
return true;
} else {
return false;
}
}