php - Foreach xml server response -


i have questions foreach. request curl , receive response in xml like:

<hotellist> <hotelsummary id=848484> <hotel>prova</hotel> <address>via bho</address> <thumbnailurl>/hotels/1000000/530000/526200/526198/526198_38_t.jpg</thumbnailurl> </hotelsummary> </hotellist> 

how can change every

<thumbnailurl>/hotels/1000000/530000/526200/526198/526198_38_t.jpg</thumbnailurl> 

to

<img src="$$server$$/hotels/1000000/530000/526200/526198/526198_38_t.jpg> 

is possible foreach?

you mean like:

$xmlobj = simplexml_load_string($your_xml_response); foreach($xmlobj->hotelsummary $hotel) {   $imgsrc = "$$server$$" . $hotel->thumbnailurl; } 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -