Solved

How to Create and Read XML Data in PHP

Posted on 2007-03-27
3
219 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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 …

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now