Hi Guys,
How come you can't use the Class's traversing methods with variable's to set the parameters
For instance Using this array:
array(0 => array('element' => 'img[src=images/more.gif]', 'attribute' => 'parent()->href'));
this works:
foreach($this->contents->find($target[$key]['element']) as $keyz => $found)
{
$this->store[$keyz] = $found->parent()->href
}
But this doesn't:
foreach($this->contents->find($target[$key]['element']) as $keyz => $found)
{
$this->store[$keyz] = $found->$target[$key]['attribute'];
}
I have tried changing they array like so:
array(0 => array('element' => 'img[src=images/more.gif]', 'traverse' => 'parent()', 'attribute' => 'href')
And then trying:
foreach($this->contents->find($target[$key]['element']) as $keyz => $found)
{
$this->store[$keyz] = $found->$target[$key]['traverse']->$target[$key]['attribute'];
}
doesn't work.
On both failures a print_r($this->store) simply gives Array();