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;
    }
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;
    }
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 ; }
Gets portion of string. Tries mb_substr and if that fails uses regular substr.
@param   string  $strText      Text to be cut up
@param   int     $intStart     Start character
@param   int     $intLength    Length
@param   string  $strEncoding  Encoding of text
@return  string
Gets portion of string . Tries mb_substr and if that fails uses regular substr .