Display Html Source With Line Numbers

Description: Great way to show the html source of a page complete with line numbers.

<?PHP
 
// Get the HTML source of google
$count = FILE ('http://www.google.com/');
// Loop through our array
FOREACH ($count AS $line_num => $line)
{
ECHO "Line #{$line_num} : " . HTMLSPECIALCHARS($line) . "<br />\n";
}
 
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.