if (!function_exists('format_phone')) { /** * 전화번호의 숫자만 취한 후 중간에 하이픈(-) 삽입 * * @param string $tel 전화번호 * * @return string */ function format_phone(string $tel) { $tel = str_replace('-', '', $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); } else if (..