How can I read an XML object file with PHP?
-
I am trying to read xml object file and store in an array for example my object file is as follow <object> <deal> <title>deal title</title> <description>deal description</description> <deal> </object> I want to read the above object file and get output likeĀ xml file as follows <deal> <title>deal title</title> <description>deal description</description> <deal>
-
Answer:
Try using simpleXml. It can read from a string or a file.
John Cleary at Quora Visit the source
Other answers
You can use SimpleXML...
Dharmalingam Arumugam
// convert XML to an array using JSON encode/decode trick $array = json_decode(json_encode(simplexml_load_string($xml_string)),true);
Nicholas de Jong
SimpleXML( ) will do the trick. Use it to parse the XML document and then delete the node you want using parent/child remove functions.
Caio Bianchi
Related Q & A:
- How can I make a dynamic web page in PHP?Best solution by Yahoo! Answers
- How can I read my yahoo e-mail via Microsoft outlook 2007?Best solution by Yahoo! Answers
- How can I read my text messages from my computer?Best solution by samsung-messages-backup.com
- How do I read an ETD extension file?Best solution by Stack Overflow
- How Can I Create an XML to Create a Menu?Best solution by Drupal Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.