0
Currently the project using a print_r in the variable xml
and it returns that:
SimpleXMLElement Object ( [cidade] => SimpleXMLElement Object ( [@attributes] => Array ( [nome] => ARACAJU [estado] => SE ) [bairros] => SimpleXMLElement Object ( [bairro] => Array ( [0] => 18 DO FORTE [1] => AEROPORTO [2] => ARUANA [3] => ATALAIA [4] => CASTELO BRANCO [5] => CENTRO [6] => CIRURGIA [7] => CORO DO MEIO [8] => COROA DO MEIO [9] => FAROLâNDIA [10] => GETúLIO VARGAS [11] => GRAGERU [12] => INáCIO BARBOSA [13] => JABOTIANA [14] => JARDINS [15] => LUZIA [16] => PONTO NOVO [17] => SALGADO FILHO [18] => SANTA MARIA [19] => SANTO ANTôNIO [20] => SUíSSA [21] => SãO CONRADO [22] => TREZE DE JULHO ) ) ) )
I would like to know how to display only the neighborhoods or just the cities
post xml as well!
– novic
At a glance here, to convert Simplexmlelement to an array, then just access via Dice
cidade
orbairros
.– fajuchem