在PHP7.0上刮削显示infinte循环?
我正在使用在PHP7.0上刮削显示infinte循环?,php,yii2,simple-html-dom,Php,Yii2,Simple Html Dom,我正在使用keltstr\simplehtmldom\extension. 在这里,我所做的是获取数据并将其存储在我的服务器上,然后从我自己的本地文件中刮取数据 但是在PHP7.0中运行良好。为什么在php版本中会出现这种情况。? 在这个函数中直接使用url时也会出现相同的错误 $url = 'https://site'; copy('https://site', \Yii::getAlias('@webroot').'/scrapping.html'); $response=\common
keltstr\simplehtmldom\extension.
在这里,我所做的是获取数据并将其存储在我的服务器上,然后从我自己的本地文件中刮取数据
但是在PHP7.0中运行良好。为什么在php版本中会出现这种情况。?
在这个函数中直接使用url时也会出现相同的错误
$url = 'https://site';
copy('https://site', \Yii::getAlias('@webroot').'/scrapping.html');
$response=\common\models\helpers\Scrapping\SimpleHtmlDom::fileGetHtml(\Yii::getAlias('@webroot').'/scrapping.html');
var_dump($response);
exit();
这是递归错误输出
这里基本上没有任何问题 infinte循环的问题就在var_dump()中 因此,请在不使用var_dump()的情况下执行其余的测试; 代码中已经有响应 在PHP7下面,需要注意的一点是,需要添加0作为偏移量
Here is the code
$response = file_get_html(url);
var_dump($response);
Here you will see the infinte loop in some server
PHP7以上的代码将是
foreach ($response->find('article',0) as $article) {
@穆罕默德·默拉斯拉姆
foreach ($response->find('article',0) as $article) {
foreach ($response->find('article') as $article) {