If you do not want to read the XML data, follow these steps:
$ xmlURL = "your xml url / filename goes here";
try { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $xmlURL); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-type: text/xml' )); $content = curl_exec($ch); $error = curl_error($ch); curl_close($ch); $obj = new SimpleXMLElement($content); echo "<pre>"; var_dump($obj); echo "</pre>"; } catch(Exception $e){ var_dump($e);exit; }
You will get a formate array of the entire xml file.
Thanks.
source share