public static function formatLines($lines, $prefixStart = 1)
    {
        $max = strlen((string)(count($lines) + $prefixStart));

        $prefixTemplate = "%{$max}d. ";
        $ret = '';
        foreach ($lines as $l => $line) {
            $ret .= sprintf($prefixTemplate, $prefixStart + $l) . $line . "\n";
        }
        return $ret;
    }
public static function formatLines($lines, $prefixStart = 1)
    {
        $max = strlen((string)(count($lines) + $prefixStart));

        $prefixTemplate = "%{$max}d. ";
        $ret = '';
        foreach ($lines as $l => $line) {
            $ret .= sprintf($prefixTemplate, $prefixStart + $l) . $line . "\n";
        }
        return $ret;
    }
public static function formatLines ( $ lines , $ prefixStart = 1 ) { $ max = strlen ( ( string ) ( count ( $ lines ) + $ prefixStart ) ) ; $ prefixTemplate = "%{$max}d. " ; $ ret = '' ; foreach ( $ lines as $ l => $ line ) { $ ret .= sprintf ( $ prefixTemplate , $ prefixStart + $ l ) . $ line . "\n" ; } return $ ret ; }
Prefix all lines with a line number starting at the given number.

@param array $lines
@param int $prefixStart
@return string
Prefix all lines with a line number starting at the given number .