How to parse text for feed with php

tsengel

New Member
Using Wikipedia API link to get some basic informations about some world known characters.Example : (About Richard Maibaum)This would show as following
VVoqy.png
Now my question I'd like to parse the xml to get such basic informations between \[code\]<search></search>\[/code\] to show it.here 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?format=xml&action=query&list=search&srsearch=Richard Maibaum&srlimit=1";$xml = simplexml_load_file($url);$extracts = $xml->xpath("/api/query/search");echo $extracts["0"];?>\[/code\]But it failed and gives blank outputSo any help ~ thanks
 
Back
Top