', $data); $start = ''; $end = ''; $i = 1; $text = ''; // Loop foreach ($data as $line) { $nbr = $i; if ($i < 10000) { $nbr = " $i"; } elseif ($i < 1000) { $nbr = "  $i"; } elseif ($i < 100) { $nbr = "   $i"; } elseif ($i < 10) { $nbr = "    $i"; } // if $text .= sprintf("%s %s:%s %s
\n", $start, $nbr, $end, str_replace("\n", '', $line)); ++$i; } // foreach // replace ... with
... to justify numbers
  $html_col = ini_get('highlight.html');
  $text = preg_replace("/()?/",
		       "", $text);
  $text = preg_replace("/(<\/span><\/code>)?/",
		       "", $text);
  $text = "".$text.""; 

  // Wrap with div class=code
  $text = '
' . $text . '
'; // Optional function linking if ($funclink === true) { $keyword_col = ini_get('highlight.keyword'); $manual = 'http://www.php.net/function.'; $text = preg_replace( // Match a highlighted keyword '~([\w_]+)(\s*)'. // Followed by a bracket '(\s*\s*\()~m', // Replace with a link to the manual '$1$2$3', $text); } // if // Return mode if ($return === false) { echo $text; } else { return $text; } // if } // phpcode ?>