i am trying to use some API which gives the response in XML file. i got the url for the response. how can i convert the url to curl and use it.it is giving xml response so i do not know how to get data from xml code.how can i get the data from xml code to my page.
Or should i convert it to the json? which is faster and better please give me some idea.And i am using PHP.
<php
require_once('amazon.php');
if(isset($_POST['search']))
{
$search=$_POST['search'];
$search=str_replace(" ", "+", $search);
$ss=new Amazon($search);
$url=$ss->amz($search);
$fileContents = file_get_contents($url);
$fileContents = str_replace(array("
", "", "\t"), '', $fileContents);
$fileContents = trim(str_replace('"', "'", $fileContents));
?>
in above code $url is the value of url i am using for response.