Go through XML array in PHP

0

Hello. I have this path that is a array position of an XML response, and I'm getting the IDcli .

I can not make a foreach that traverses this array and shows IDcli .

$xml = simplexml_load_string($obj);

$xml->sis->cont->Clis->Cli[0]->IDcli;

I tried only for , but only counts up to 9 :

for ( $j = 0; $j < count( $xml->sis->cont->Clis->Cli[$j]->IDcli ); $j++ ) {
  echo "<br>".$xml->sis->cont->Clis->Cli[$j]->IDcli;
}
    
asked by anonymous 27.05.2015 / 22:18

1 answer

0

I did that, and it worked.

$tuas_tags = $xml->sis->cont->Clis->Cli[0]->IDcli;

foreach ( $tuas_tags as $tua_tag )
{
    echo "<br>".$tua_tag->IDcli;

}

Thank you for trying.

    
27.05.2015 / 22:26