PHP : Display source code of any webpage

<?php 
// display source code
$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) . "<br>\n";
}
?>

Source: http://perishablepress.com/code-snippets/#code-snippets_php

Processing your request, Please wait....

No Responses to “PHP : Display source code of any webpage”

Comments (Your Comments)

Leave a Reply

You must be logged in to post a comment.