public function getMaxLineLength($lines)
    {
        if (!is_array($lines)) {
            $lines = explode("\n", $lines);
        }
        $lineLength = 0;
        // find the longest line
        foreach ($lines as $line) {
            $currentLineLength = strlen($line);
            if ($currentLineLength > $lineLength) {
                $lineLength = $currentLineLength;
            }
        }
        return $lineLength;
    }
public function getMaxLineLength($lines)
    {
        if (!is_array($lines)) {
            $lines = explode("\n", $lines);
        }
        $lineLength = 0;
        // find the longest line
        foreach ($lines as $line) {
            $currentLineLength = strlen($line);
            if ($currentLineLength > $lineLength) {
                $lineLength = $currentLineLength;
            }
        }
        return $lineLength;
    }
public function getMaxLineLength ( $ lines ) { if ( ! is_array ( $ lines ) ) { $ lines = explode ( "\n" , $ lines ) ; } $ lineLength = 0 ; // find the longest line foreach ( $ lines as $ line ) { $ currentLineLength = strlen ( $ line ) ; if ( $ currentLineLength > $ lineLength ) { $ lineLength = $ currentLineLength ; } } return $ lineLength ; }
Find the longest line and get the line length
@param array $lines
@return int
Find the longest line and get the line length