public static function substring($strText, $intStart, $intLength, $strEncoding = '')
{
if (is_null(self::$blnMbstring)) {
self::$blnMbstring = extension_loaded('mbstring');
}
if (!self::$blnMbstring) {
$strSubstring = substr($strText, $intStart, $intLength);
} else {
if ($strEncoding == '') {
$strSubstring = mb_substr($strText, $intStart, $intLength);
} else {
$strSubstring = mb_substr($strText, $intStart, $intLength, $strEncoding);
}
}
return $strSubstring;
}