how to read xml file from url using php

后端 未结 5 1121
广开言路
广开言路 2020-12-03 07:02

I have to read an XML file from an URL

$map_url = \"http://maps.google.com/maps/api/directions/xml?origin=\".$merchant_address_url.\"&destination=\".$cus         


        
5条回答
  •  被撕碎了的回忆
    2020-12-03 07:25

    $url = 'http://www.example.com'; $xml = simpleXML_load_file($url,"SimpleXMLElement",LIBXML_NOCDATA);

    $url can be php file, as long as the file generate xml format data as output.

提交回复
热议问题