php - How can I use the CakePHP APP class to load XML files from a URL? -


I am using CakePHP XmlHelper to parse XML files:

  App :: import ('Xml'); $ File = "my_xml_file.xml"; $ Parsed_xml = & amp; New XML ($ file);  

How can I use it to load XML files from the URL

Thank you!

this is easy

  app :: import ('xml' ); $ Url = "http://www.example.com/xml_file.xml"; $ Parsed_xml = & amp; New XML ($ url);  

Using a URL instead of a file, the cake will choose the way to open the file internally


Comments