Returns the length of the longest string in the given array

@param array $string

@return int
774391
public static function maxStrlen(array $string)
    {
        $length = 0;
        foreach ($string as $str) {
            if (strlen($str) > $length) {
                $length = strlen($str);
            }
        }

        return $length;
    }
995770
private function _getActualLength ( $text ) {
        $convertedText = $this->_convertTagsToEscapeSequences($text);
        $strippedText = $this->_stripEscapeSequences($convertedText);
        $length = mb_strlen($strippedText, 'utf-8');
        return $length;
    }
165183
private function maxLength()
	{
		$max = mb_strlen($this->value);
		if (!$ret = $max <= $this->options->max) {
			$this->error(1);
		}

		return $ret;
	}
782980
public function read($length)
    {
        if ($this->offset == $this->array_size) {
            return false;
        }

        // Don't use array slice
        $arrays = [];
        $end = $length + $this->offset;
        for ($i = $this->offset; $i < $end; ++$i) {
            if (!isset($this->array[$i])) {
                break;
            }
            $arrays[] = $this->array[$i];
        }
        $this->offset += $i - $this->offset; // Limit function calls
        $chars = false;
        foreach ($arrays as $array) {
            $chars .= implode('', array_map('chr', $array));
        }

        return $chars;
    }
511333
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);
    }
1237941
private function getChunkedString($string)
    {
        $firstLine = '';
        if ($this->tell() !== 0) {
            $next = $this->lineLength - ($this->position % ($this->lineLength + $this->lineEndingLength));
            if (strlen($string) > $next) {
                $firstLine = substr($string, 0, $next) . $this->lineEnding;
                $string = substr($string, $next);
            }
        }
        // chunk_split always ends with the passed line ending
        $chunked = $firstLine . chunk_split($string, $this->lineLength, $this->lineEnding);
        return substr($chunked, 0, strlen($chunked) - $this->lineEndingLength);
    }
1344941
public function endsWith($substring) {
		$substringLength = mb_strlen($substring, $this->encoding);
		$endOfStr = mb_substr($this->string, $this->length() - $substringLength, $substringLength, $this->encoding);

		return (string) $substring === $endOfStr;
	}
1191670
protected function getLengths(array $data)
    {
        for ($i = 0; $i < $this->columns; $i++) {
            $this->maxLength[$i] = 0;
            foreach ($this->headers as $field) {
                $field = strip_tags($field);
                if (strlen($field) > $this->maxLength[$i]) {
                    $this->maxLength[$i] = strlen($field);
                }
            }
        }

        foreach ($data as $row) {
            $i = 0;
            foreach ($row as $field) {
                $field = strip_tags($field);
                if (strlen($field) > $this->maxLength[$i]) {
                    $this->maxLength[$i] = strlen($field);
                }
                $i++;
            }
        }
    }
127309
protected function getLongestKey(array $array)
    {
        $longest = 0;

        foreach ($array as $key => $value) {
            if ($longest > strlen($key)) continue;

            $longest = strlen($key);
        }

        return $longest;
    }
236602
public static function truncateToEndOfSentence($string, $length = 60){

		assert('$length >= 10');

		$string = ucfirst($string . '. ');
		$string = preg_replace('/(?:\r?\n)+/', ' ', $string);
		if(strlen($string) > $length){

			$string = substr($string, 0,
				strpos($string, '. ', $length));
		}

		$string = trim($string, '. ') . '.';
		return $string;
	}
809009
protected function processTokens($string)
    {
        $this->tokens = [];
        $this->previousToken = '';
        $this->currentStringLength = \strlen($string);
        $this->oldStringLength = \strlen($string) + 1;

        while ($this->currentStringLength >= 0) {
            if ($this->oldStringLength <= $this->currentStringLength) {
                break;
            }
            $string = $this->processOneToken($string);
        }

        return $this->tokens;
    }
761653
public static function length($string, $charset = 'UTF-8')
    {
        $charset = self::lower($charset);

        if ($charset == 'utf-8' || $charset == 'utf8') {
            return strlen(utf8_decode($string));
        }

        if (Horde_Util::extensionExists('mbstring')) {
            $ret = @mb_strlen($string, self::_mbstringCharset($charset));
            if (!empty($ret)) {
                return $ret;
            }
        }
        if (Horde_Util::extensionExists('intl')) {
            return grapheme_strlen(
                self::convertCharset($string, $charset, 'UTF-8')
            );
        }

        return strlen($string);
    }
258118
private function __validateString($string, $minLength = 1, $maxLength = 0)
    {
        if (!is_string($string)) {
            $this->error = 'parameter is not string.';
            return false;
        } else if ($maxLength > 0 && strlen($string) > $maxLength) {
            $this->error = 'parameter is too long. string:' . $string;
            return false;
        } else if (strlen($string) < $minLength) {
            $this->error = 'parameter is too short. string:' . $string;
            return false;
        }
        return true;
    }
581106
public function getTokenWeight($string)
    {
        if($this->getTotalByToken($string)){
            return $this->getTotalByToken($string)/$this->getTotalTokens();
        } else {
            return false;
        }
    }
911735
public function shannonEntropy($String)
    {
        if (!$Len = strlen($String)) {
            return 0;
        }
        $Chars = [];
        for ($Pos = 0; $Pos < $Len; $Pos++) {
            $Char = substr($String, $Pos, 1);
            if (!isset($Chars[$Char])) {
                $Chars[$Char] = 0;
            }
            $Chars[$Char]++;
        }
        $Total = 0;
        foreach ($Chars as $Char) {
            $Total += abs(($Char / $Len) * log(($Char / $Len), 2));
        }
        return $Total;
    }
342795
public static function getMaxKeyLength(array $array)
    {
        $maxKeyLength = '0';
        foreach ($array as $key => $value) {
            $currentLength = static::getVisibleStringLength($key);

            if ($currentLength > $maxKeyLength) {
                $maxKeyLength = $currentLength;
            }
        }

        return $maxKeyLength;
    }
365823
protected function maxMultidimensionalArrayStringSize(array $data)
    {
        $lengths = [];
        for ($i =0; $i < count($data); $i++) {
            for ($j = 0; $j < count($data[$i]); $j++) {
                $temp_length = strlen($data[$i][$j]);
                if (!isset($lengths[$j])) {
                    $lengths[$j] = $temp_length;
                    continue;
                } elseif ($lengths[$j] < $temp_length) {
                    $lengths[$j] = $temp_length;
                    continue;
                }
            }
        }
        return $lengths;
    }