I am using the following code
$page_data=array();//$title_links is array having urls
$nodearr=array();
foreach ($title_links as $b_url)
{
$page_data[]= mycurl($b_url);//my curl function, it is okay
$dom2 = new DOMDocument();//creating new domdocument object inside a domdocument object
@$dom2->loadHTML($page_data[]);
$xpath_cat = new DOMXPath($dom2);//same as domdocument , nesting xpath
$nodelist = $xpath_cat->query('//span[@class="zg_hrsr_ladder"]', $dom2);
//echo nodeslist;
foreach ($nodelist as $node) {
$nodearr[] = $node->textContent;
}
}
so the scenerio is ,
I am nesting a 'domdocument' inside an other 'DomDocument' using 'foreach loop', i am inserting Array Element in DomDocument aslo, as i am nestind domdocument inside domdocument , so i am declaring new xpath query
The Question is ...
Clarification:
$title_links is obtained using curl, it is urls extracted from web page using domdocument and xpath query. so $title_links is at first level of xpath and domdocument, and $nodelist is at the 2nd level of nesting od xpath and dom-document