How to parse image feed with php

mintdesignnz

New Member
Using Wikipedia API link to get main image about some world known characters/events.Example : (Stanislao Mattei)This would show as following
wi24B.png
Now my question I'd like to parse the xml to get image url to be shown uphere is the code i'm willing to use if it right ~ thanks to ccKep ~\[code\]<?PHPini_set("user_agent","Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");$url = "http://en.wikipedia.org/w/api.php?action=query&list=allimages&aiprop=url&format=xml&ailimit=1&aifrom=Stanislao Mattei";$xml = simplexml_load_file($url);$extracts = $xml->xpath("/api/query/allimages");var_dump($extracts);?>\[/code\]It should gives results as arrayhow i can get among it the exact url of the image to be shown should be : \[code\]http://upload.wikimedia.org/wikipedia/en/a/a1/Stanislaus.jpg\[/code\]to put it in html code\[code\]<img src="http://upload.wikimedia.org/wikipedia/en/a/a1/Stanislaus.jpg">\[/code\]~ Thanks a lot
 
Back
Top