/** * 문자열 절반 마킹 * @param string $str * @param int $char * @param string $charset * @return string */ function marking($str, $char = '*', $charset = 'UTF-8') { $len = mb_strlen($str, $charset); $pos = ceil($len / 2); if($len > 14) return str_repeat($char, $len - $pos).mb_substr($str, $pos, $len - $pos, $charset); else return mb_substr($str, 0, $pos, $charset).str_repeat($char, $len - $pos); }