public static function maxCharWidth($string)
    {
        $chars = preg_split('//u', $string, null, PREG_SPLIT_NO_EMPTY);

        if (!$chars) {
            return 0;
        }

        $sizes = array_map('strlen', $chars);

        return max($sizes);
    }
public static function maxCharWidth($string)
    {
        $chars = preg_split('//u', $string, null, PREG_SPLIT_NO_EMPTY);

        if (!$chars) {
            return 0;
        }

        $sizes = array_map('strlen', $chars);

        return max($sizes);
    }
public static function maxCharWidth ( $ string ) { $ chars = preg_split ( '//u' , $ string , null , PREG_SPLIT_NO_EMPTY ) ; if ( ! $ chars ) { return 0 ; } $ sizes = array_map ( 'strlen' , $ chars ) ; return max ( $ sizes ) ; }
Get max bytes needed per char.

@param string $string

@return int
Get max bytes needed per char .