how to read xml file from url using php

scoulfuse

New Member
i have to read an xml file from url \[code\] $map_url = "http://maps.google.com/maps/api/directions/xml?origin=".$merchant_address_url."&destination=".$customer_address_url."&sensor=false";\[/code\]This give me url like:http://maps.google.com/maps/api/dir...k,+New+York,+10001+United+States&sensor=false I am using this function to read and then get data\[code\] $response_xml_data = http://stackoverflow.com/questions/12542469/file_get_contents($map_url); if($response_xml_data){ echo"read"; } $data = http://stackoverflow.com/questions/12542469/simplexml_load_string($response_xml_data); echo"<pre>"; print_r($data); exit; \[/code\]but no luc, any help?
 
Back
Top