如何解决致命错误:耗尽了536870912字节的允许的内存大小(尝试分配266342400字节)

时间:2019-06-21 11:01:40

标签: php html simple-html-dom

<?php

include_once 'simple_html_dom.php';

ini_set("memory_limit", "536870912");

$Ptype = htmlspecialchars($_GET["type"]);

if ($Ptype == 'conditin') {

    $url = "Some_url";
    getScraping($url);


} else if ($Ptype == 'conditin') {

    $url = "Some_url";
    getScraping($url);

} else {
    exit('SEND ?type = conditin or conditin');
}   


function getScraping($url)
{

    $html = file_get_html($url);

    $data = $html->find('[class=box]');   
    if (isset($data[0])) {

        $count = 1;
        $array = array();

        do {

            $child = $data[0]->children($count);

            if (isset($child)) {
                $available = true;

                array_push($array, $temp);

            } else {
                $available = false;
            }

            $count++;
        } while ($available);

    }

    echo json_encode($array);
}

This code linked with a 
http://sourceforge.net/projects/simplehtmldom/ latest file

它将值发送到该文件到简单的HTML dom,然后过滤html代码并将其发送回去,但是enter image description here

在不打印的情况下显示enter image description here

当我增加内存大小限制时,它仍然显示相同的错误

0 个答案:

没有答案