I have an array as follows:
array(
'items' => array(
'item' => array(
(int) 0 => array(
'@item' => '3-394-001068-00000'),
(int) 1 => array(
'@item' => '3-394-001069-00000'),
)
)
)
I am trying to extract all the 'item' entries to a new array.
Here is my code so far:
$xmlarray = Xml::toArray(Xml::build(WWW_ROOT .'files/itemsAll/'.$file));
debug($xmlarray);
$results = Hash::extract($xmlarray, '{n}.item');
debug ($results);
but this returns only an empty array. Could someone maybe give me a hint where I'm going wrong?
thanks in advance