i am trying to parse a xml data using the an api url which i have used in the following code. when i run this url directly in the browser it gives me a xml formatted data like below.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>B4DE627B9936548B</RequestId>
<HostId>LyB4mVbYLYF/a26Wn04sSuMlTwQjLozl11O9Ql2YbMwHgenXRUCd7WAn5QPRa6nj</HostId>
</Error>
but i want this xml in an array then i will itrate that array using foreach loop.
curl_setopt($ch, CURLOPT_URL,'http://mybucket.s3.amazonaws.com
/11111.mpg&mpaction=convert%20format=flv');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Your application name');
$query = curl_exec($ch);
curl_close($ch);
echo $query;
?>
when i print the variable $query it gives me only the text of xml. i want this xml in an array. please help me