Solved

How to Create and Read XML Data in PHP

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
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 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…

832 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