- function display_sourcecode($url)
- {
- $lines = file($url);
- $output = "";
- foreach ($lines as $line_num => $line) {
- // loop thru each line and prepend line numbers
- $output.= "Line #{$line_num} : " . htmlspecialchars($line) . "
\n"; - }
- }
用法: - $url = "http://www.open-open.com";
- $source = display_sourcecode($url);
- echo $source;
- ?>
|