Created
March 15, 2013 15:17
-
-
Save blendax78/5170590 to your computer and use it in GitHub Desktop.
Display source code of a webpage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // display source code | |
# Example: $url = 'http://google.com'; | |
$lines = file($url); | |
foreach ($lines as $line_num => $line) { | |
// loop thru each line and prepend line numbers | |
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br>\n"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment