Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
简单的php dom解析器不';无法使用本地url_Php_Parsing_Dom - Fatal编程技术网

简单的php dom解析器不';无法使用本地url

简单的php dom解析器不';无法使用本地url,php,parsing,dom,Php,Parsing,Dom,不适用于此url。有什么问题? 获取错误-PHP注意:尝试获取非对象的属性 <?php include ('config.php'); include('simple_html_2012.php'); echo file_get_html('http://www.localhost/test/test.html')->plaintext; ?> 如果试图解析google.com,一切都会成功 echo file_get_html('http://localhost/te

不适用于此url。有什么问题? 获取错误-PHP注意:尝试获取非对象的属性

<?php
include ('config.php');
include('simple_html_2012.php');
echo file_get_html('http://www.localhost/test/test.html')->plaintext; 
?>

如果试图解析google.com,一切都会成功

echo file_get_html('http://localhost/test/test.html')->plaintext;

可能有帮助:

    if($source = file_get_contents("http://localhost/test/test.html"))
    {
        $html = str_get_html($source);
        echo $html->plaintext;
    }
    else
    {
        echo "Something wrong!";
    }
可能有帮助:

    if($source = file_get_contents("http://localhost/test/test.html"))
    {
        $html = str_get_html($source);
        echo $html->plaintext;
    }
    else
    {
        echo "Something wrong!";
    }
可能有帮助:

    if($source = file_get_contents("http://localhost/test/test.html"))
    {
        $html = str_get_html($source);
        echo $html->plaintext;
    }
    else
    {
        echo "Something wrong!";
    }
可能有帮助:

    if($source = file_get_contents("http://localhost/test/test.html"))
    {
        $html = str_get_html($source);
        echo $html->plaintext;
    }
    else
    {
        echo "Something wrong!";
    }


www.localhost
?在前面的
www.
?仍在第41行的/var/www/test/index.php中尝试获取非对象的属性)URL有效吗?(即,你能将其粘贴到浏览器中并获取站点吗?)2)你是否禁用了
allow\u url\u fopen
?NetBeans告诉我OutOfMemoryError你的意思是你的IDE正在崩溃,还是你收到了不同的PHP错误消息,这取决于你运行脚本的方式。前者与IMHO无关,后者需要一些细节。
www.localhost
?在前面的
www.
?仍在第41行的/var/www/test/index.php中尝试获取非对象的属性)URL有效吗?(即,你能将其粘贴到浏览器中并获取站点吗?)2)你是否禁用了
allow\u url\u fopen
?NetBeans告诉我OutOfMemoryError你的意思是你的IDE正在崩溃,还是你收到了不同的PHP错误消息,这取决于你运行脚本的方式。前者与IMHO无关,后者需要一些细节。
www.localhost
?在前面的
www.
?仍在第41行的/var/www/test/index.php中尝试获取非对象的属性)URL有效吗?(即,你能将其粘贴到浏览器中并获取站点吗?)2)你是否禁用了
allow\u url\u fopen
?NetBeans告诉我OutOfMemoryError你的意思是你的IDE正在崩溃,还是你收到了不同的PHP错误消息,这取决于你运行脚本的方式。前者与IMHO无关,后者需要一些细节。
www.localhost
?在前面的
www.
?仍在第41行的/var/www/test/index.php中尝试获取非对象的属性)URL有效吗?(即,你能将其粘贴到浏览器中并获取站点吗?)2)你是否禁用了
allow\u url\u fopen
?NetBeans告诉我OutOfMemoryError你的意思是你的IDE正在崩溃,还是你收到了不同的PHP错误消息,这取决于你运行脚本的方式。前者与IMHO无关,后者需要一些细节。仍然试图在第4行的/var/www/test/index.php中获取非对象的属性您是否尝试过使用file\u get\u contents而不是file\u get\u html?php.net/manual/en/function.file-get-contents.phpStill试图在第4行的/var/www/test/index.php中获取非对象的属性您是否尝试过使用file_get_contents而不是file_get_html?php.net/manual/en/function.file-get-contents.phpStill试图在第4行的/var/www/test/index.php中获取非对象的属性您是否尝试过使用file_get_contents而不是file_get_html?php.net/manual/en/function.file-get-contents.phpStill试图在第4行的/var/www/test/index.php中获取非对象的属性您是否尝试过使用file_get_contents而不是file_get_html?php.net/manual/en/function.file-get-contents.phpif($html->innertext!=null){echo“good”;}否则{echo“bad”;}/$html是null netbeans告诉我OutOfMemoryErrorif($html->innertext!=null){echo“good”;}/$html是null告诉我OutOfMemoryErrorif($html->innertext!=null){echo“good”;}否则{echo“bad”;}/$html为null如果($html->innertext!=null){echo“good”;}否则{echo“bad”;}/$html为null NetBeans告诉我OutOfMemoryError