휴대폰 번호 만들기를 hyphen_hp_number 함수로 처리

This commit is contained in:
gnuboard
2013-04-26 13:53:25 +09:00
parent ba2874565c
commit da3c09523c
5 changed files with 49 additions and 71 deletions

View File

@ -1969,4 +1969,12 @@ function html_end()
}
return preg_replace('#(</title>)#', "$1$stylesheet", $buffer);
}
// 휴대폰번호의 숫자만 취한 후 중간에 하이픈(-)을 넣는다.
function hyphen_hp_number($hp)
{
$hp = preg_replace("/[^0-9]/", "", $hp);
return preg_replace("/([0-9]{3})([0-9]{3,4})([0-9]{4})$/", "\\1-\\2-\\3", $hp);
}
?>