获取任意 Web 页面的 HTML 代码

function display_sourcecode($url)
{
  $lines = file($url);
  $output = "";
  foreach ($lines as $line_num => $line) {
    // loop thru each line and prepend line numbers
    $output .= "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br>\n";
  }
}

  

posted on 2017-06-06 17:20  泪滴  阅读(180)  评论(0编辑  收藏  举报