display html source with line numbers

display html source 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";
}
?>