Last active
December 18, 2015 08:09
-
-
Save shyamsalimkumar/5752467 to your computer and use it in GitHub Desktop.
PHP - Display source code of any 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
$lines = file('http://google.com/'); | |
foreach ($lines as $line_num => $line) { | |
// loop thru each line and prepend line numbers | |
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . " | |
\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment