- <?php
- // display source code
- $lines = file('http://www.hongniang.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";
- }
转载于:https://blog.51cto.com/rabbit1987/1178516