foreach语句中的PHP设置数组挂起

foreach语句中的PHP设置数组挂起,php,arrays,loops,foreach,html-parsing,Php,Arrays,Loops,Foreach,Html Parsing,我正在使用简单的DOM HTML解析器库解析一些HTML,在我的foreach语句中,我正在尝试以下面的格式向数组添加一些值。然而,循环挂起,chrome每次都会收到一条“Aw Snap”消息。出什么事了 数组格式: Array ( [wccca_number] => xxx [call_name] => xxx [address] => xxx [county] => xxx [station] => xxx [de

我正在使用简单的DOM HTML解析器库解析一些HTML,在我的foreach语句中,我正在尝试以下面的格式向数组添加一些值。然而,循环挂起,chrome每次都会收到一条“Aw Snap”消息。出什么事了

数组格式:

Array
(
    [wccca_number] => xxx
    [call_name] => xxx
    [address] => xxx
    [county] => xxx
    [station] => xxx
    [department] => xxx
    [units] => xxx
    [call_created] => xxx
)
Array
(
    [wccca_number] => xxx
    [call_name] => xxx
    [address] => xxx
    [county] => xxx
    [station] => xxx
    [department] => xxx
    [units] => xxx
    [call_created] => xxx
)
代码:


服务器端日志文件怎么说?没有错误,只是让chrome崩溃。哇,我发现了问题。我尝试添加对象,而不是调用innertext$wccca_编号->内部文本。
Class WCCCA_HTMLParser {

    private $html;
    private $wa_county_header;
    private $cla_county_header;
    private $active_calls;
    private $wa_calls_array;
    private $cla_calls_array;

    public function __construct()  {  

        $this->html                  = file_get_html('http://www.wccca.com/PITSv2/');
        $this->wa_county_header      = $this->html->find('div[id=wccca-incidents]');  
        $this->cla_county_header     = $this->html->find('div[id=ccom-incidents]');  
        $this->active_calls          = array(); 
        $this->wa_calls_array        = array();
        $this->cla_calls_array       = array();

        $this->find_wa_county_calls();

        print_r($this->wa_calls_array);
    }  

    public function find_wa_county_calls () {

        foreach ($this->wa_county_header as $call_header) {

            foreach ($call_header->find('div[id^=list_]') as $node) {

                $call_name = $node->children(0)->children(1)->children(1)->children(0); // Path to the call text

                $address = $node->children(1)->children(1)->children(0); // Path to the address text

                $wccca_number = $node->children(1)->children(1)->children(1)->children(0); // Path to the WCCCA Number text

                $call_created = $node->children(2)->children(1)->children(0)->children(0); // Path to the call created text

                $department = $node->children(3)->children(0)->children(0)->children(0); // Path to the department text

                $station = $node->children(3)->children(0)->children(0)->children(1); // Path to the station text

                $units_node = $node->children(3)->children(0)->children(0)->children(2); // Path to the units text
                $units_array = array();
                foreach ($units_node->find('span') as $unit) {
                    array_push($units_array, $unit->innertext);
                }
                $units = implode(', ', $units_array);

                $county = 'W'; // Set the county character

                $this->wa_calls_array['wccca_number'] = $wccca_number;
                $this->wa_calls_array['call_name'] = $call_name;
                $this->wa_calls_array['address'] = $address;
                $this->wa_calls_array['county'] = $county;
                $this->wa_calls_array['station'] = $station;
                $this->wa_calls_array['department'] = $department;
                $this->wa_calls_array['units'] = $units;
                $this->wa_calls_array['call_created'] = $call_created;
            }
        }
    }
}