Solved

How to Create and Read XML Data in PHP

Posted on 2007-03-27
3
264 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

690 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