A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearParse an xml document located on the internet and convert to json - page 1
User InfoPosts
Parse an xml document located on the internet and convert to json#1
I found http://www.ibm.com/developerworks/xml/library/x-xml2jsonphp/ , but I don(t know how to use this code to get the xml from my web server. any ideas?

posted date: 2009-04-15 10:50:00


Re: Parse an xml document located on the internet and convert to json#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-15 10:50:01


Re: Parse an xml document located on the internet and convert to json#3
The simplest way is with file_get_contents()$xmlString = file_get_contents((http://www...../file.xml();If you want a SimpleXML object you can use simplexml_load_file()$xml = simplexml_load_file((http://www...../file.xml();Both these methods require allow_url_fopen to be enabled. If it isn(t, you can use curl - this is more complicated but also gives you more flexibility.$c = curl_init((http://www...../file.xml();curl_setopt($c, CURLOPT_RETURNTRANSFER, true);$xmlString = curl_exec($c);$error = curl_error($c);curl_close($c);if ($error) die((Error: ( . $error);

posted date: 2009-04-15 10:53:00


select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.