$lines = explode("\n",file_get_contents('http://www.yahoo.co.jp'));
foreach ($lines as $line_num => $line) { 
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n"; 
}