제품 사용처리 기능
This commit is contained in:
@ -199,3 +199,17 @@ function annu_send_sms($phone, $message) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// 전화번호에 하이픈 추가
|
||||
function add_hyphen($tel){
|
||||
$tel = preg_replace("/[^0-9]*/s","",$tel); //숫자이외 제거
|
||||
|
||||
if (substr($tel,0,2) =='02'){
|
||||
return preg_replace("/([0-9]{2})([0-9]{3,4})([0-9]{4})$/","\\1-\\2-\\3", $tel);
|
||||
} else if(substr($tel,0,2) =='8' && substr($tel,0,2) =='15' || substr($tel,0,2) =='16'|| substr($tel,0,2) =='18' ) {
|
||||
return preg_replace("/([0-9]{4})([0-9]{4})$/","\\1-\\2",$tel); // 지능망 번호이면
|
||||
} else {
|
||||
return preg_replace("/([0-9]{3})([0-9]{3,4})([0-9]{4})$/","\\1-\\2-\\3" ,$tel); //핸드폰번호만 이용한다면 이것만있어도됨
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user