1
I’m trying to extract some information from a xml and I’m not getting, what I can get is the date that’s on the node weather, but icon and text I can’t seem to get them in sequence.
The previous information is in a structure that repeated until then, in this case the same is changed.
The code I tried to retrieve the information I need is this:
foreach($itemIcone->data->item->weather->item as $reg) {
// ZERANDO O ARRAY
$data = array();
// ÍCONES
$data['api']['data']['item']['weather']['item'][] = array
(
// LENDO OS NÓS
'date' => (string)$reg['date']
);
// ATRIBUINDO AS VARIÁVEIS
$Data = $data['api']['data']['item']['weather']['item'][0]['date'];
$IcoManha = $data['api']['data']['item']['weather']['item'][0]['date']['icon'][0]['morning'];
}
The image of what I have at the moment follows below.

You are using
simplexmlordomdocument? Edit your question and put the example ofxml– Marcelo de Andrade
Hello @Marcelodeandrade, I’m using the simplexml_load_string.
– adventistapr