代码之家  ›  专栏  ›  技术社区  ›  oopbase Jayachandran Murugesh

获取页面的源代码并分配其内容

php
  •  0
  • oopbase Jayachandran Murugesh  · 技术社区  · 14 年前

    我正在分析网页的源代码,如下所示:

        private function readPage() {
            header("Content-type: text/plain"); 
            $this->pageSource = @readfile ($this->page);    
        }
    

    但似乎我无法将内容赋给“pagesource”变量。我的错在哪里?

    非常感谢你的帮助。

    1 回复  |  直到 14 年前
        1
  •  3
  •   Daniel Egeberg    14 年前

    readfile() 读取文件并将其输出到stdout。我想你可能在找 file_get_contents() .

    推荐文章