Update base.php

This commit is contained in:
Namhyeon Go 2018-01-01 02:00:50 +09:00 committed by GitHub
parent dcf19b6bcc
commit e81f5a2485
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,3 +14,18 @@ if(function_exists('array_key_empty')) {
return $empty;
}
}
if(!function_exists("cut_str")) {
function cut_str($str, $start, $len=0) {
$cutted_str = "";
if(function_exists("iconv_substr")) {
$cutted_str = iconv_substr($str, $start, $len, "utf-8");
} elseif(function_exists("mb_substr")) {
$cutted_str = mb_substr($str, $start, $len);
} else {
$cutted_str = substr($start, $len);
}
return $cutted_str;
}
}