Update string.utl.php

This commit is contained in:
Namhyeon Go 2018-09-10 01:30:13 +09:00 committed by GitHub
parent 58ee1b446f
commit 2be0ba580f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,8 +6,9 @@
* @brief String utility helper
*/
if(!function_exists("add_hyphen")) {
function add_hyphen($tel) {
// for Korean Telephone Number
if(!function_exists("parse_tel_number_kr")) {
function parse_tel_number_kr($tel) {
$tel = preg_replace("/[^0-9]/", "", $tel); // 숫자 이외 제거
if (substr($tel,0,2)=='02')
return preg_replace("/([0-9]{2})([0-9]{3,4})([0-9]{4})$/", "\\1-\\2-\\3", $tel);