Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Convert XML to JSON in PHP

Use server-side code to streamline Ajax

Summary: 

With the growing popularity of Web 2.0, a new data interchange format called JavaScript Object Notation (JSON) is emerging as a useful way to represent data in the business logic running on browsers. Learn how PHP-based server programs can convert XML-formatted enterprise application data into JSON format before sending it to browser applications.

As a followup to reader comments, the author made updates to Listing 6 and the download file of source code.

Date:  05 Jun 2007 (Published 16 Jan 2007)
Level:  Intermediate
Also available in:   Chinese  Russian  Japanese

Activity:  151369 views
Comments: