protected function strlen($string)
    {
        // don't count color codes
        $string = preg_replace("/\33\\[\\d+(;\\d+)?m/", '', $string);

        if (function_exists('mb_strlen')) {
            return mb_strlen($string, 'utf-8');
        }

        return strlen($string);
    }
protected function strlen($string)
    {
        // don't count color codes
        $string = preg_replace("/\33\\[\\d+(;\\d+)?m/", '', $string);

        if (function_exists('mb_strlen')) {
            return mb_strlen($string, 'utf-8');
        }

        return strlen($string);
    }
protected function strlen ( $ string ) { // don't count color codes $ string = preg_replace ( "/\33\\[\\d+(;\\d+)?m/" , '' , $ string ) ; if ( function_exists ( 'mb_strlen' ) ) { return mb_strlen ( $ string , 'utf-8' ) ; } return strlen ( $ string ) ; }
Measures char length in UTF-8 when possible

@param $string
@return int
Measures char length in UTF - 8 when possible