Question about PHP and XML
By comedyaddict
@comedyaddict (772)
Canada
April 25, 2008 11:53pm CST
Hi everyone.. hopefully someone can help me on this. I am trying to use an API from a website and then parse the information into my own website.
The API URL is http://lyricsfly.com/api/api.php?i=31b62039fb7d0ec00&a=Creed&t=Higher which provides a XML file.
Does anyone know a way to parse an XML file (via a URL) into something usuable in PHP?
Thanks!
1 person likes this
1 response
@vivekwin_09 (4)
•
6 Sep 08
There are nothings but some things in use when you parse the API Some Examle i give below.
$aplilinkname="your api link";
$xml = @simplexml_load_file($aplilinkname) or die ("no file loaded");
foreach($xml-adresults-record as $record1){
$title = addslashes($record1-title);
$url= addslashes($record1-url);
....
Parse all the tags which are use in this Xml files
![](/Content/images/loading.gif)