Solved

How to Create and Read XML Data in PHP

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

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…
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

734 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