Solved

How to Create and Read XML Data in PHP

Posted on 2007-03-27
3
254 Views
Last Modified: 2008-02-01
Hello,

I need to submit some information (say, employee_id, employee_first_name, and employee_second_name) to a URL. In return the page would receive data in XML format.

Can you please guide me as to how to create a XML object in PHP to pass it on to the URL? Also, please let me know how to read back the data given in XML format. Piece of source code would be of good help.

Regards,
Thanks-in-Advance


0
Comment
Question by:Thanks-in-advance
  • 2
3 Comments
 
LVL 49

Expert Comment

by:Roonaan
ID: 18799582
Firstmost question: Which php version are you using?

Kind regards

-r-
0
 

Author Comment

by:Thanks-in-advance
ID: 18805719
PHP 4.3.4.
0
 
LVL 49

Accepted Solution

by:
Roonaan earned 250 total points
ID: 18805952
Then you might look into the xml serialize and deserialize xml library by Keith Devens (http://keithdevens.com/software). It converts xml into an array allowing easy access.
For creating xml you can just use a string:

$myXml = '<my><xml /></my>';
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question