Update string.utl.php

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

View File

@ -20,6 +20,27 @@ if(!function_exists("parse_tel_number_kr")) {
}
}
if(!function_exists("get_converted_string")) {
function get_converted_string($str, $to_charset, $from_charset, $method="iconv") {
$output = false;
switch($method) {
case "iconv":
if(function_exists("iconv")) {
$output = iconv($from_charset, $to_charset, $str);
}
break;
case "mb":
if(function_exists("mb_convert_encoding")) {
$output = mb_convert_encoding($str, $to_charset, $from_charset);
}
break;
}
return $output;
}
}
if(!function_exists("nl2p")) {
function nl2p($string) {
$paragraphs = '';