メールフォームで郵便番号の正規表現(関数式)
function check_postnum($str) {
if (preg_match("/^\d{3}\-\d{4}$/", $str)) {
return true;
} else {
return false;
}
}
メールフォームで郵便番号の正規表現(関数式)
function check_postnum($str) {
if (preg_match("/^\d{3}\-\d{4}$/", $str)) {
return true;
} else {
return false;
}
}