我怎样才能将网址转换为curl并使用它。这个网址给出了xml响应所以我不知道如何从xml代码中获取数据

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.