SimpleXML for 4.3

Posted on 2007-04-05
Last Modified: 2013-12-12
I had a link that I can't find to some code that would act like the new SimpleXML function in php5. Does anyone know of any code that can act like SimpleXML in php 4.3. Specifically it reads the XML string or document and turns it into a PHP Object.
Question by:Isisagate
  • 3
  • 2
LVL 23

Accepted Solution

Stacy Spear earned 500 total points
ID: 18859383
LVL 23

Expert Comment

by:Stacy Spear
ID: 18859399
Oops, you did say object. Its already there as XML DOM. Or maybe you need to compile it in if it isn't.
LVL 11

Author Comment

ID: 18885494
Well the thing is the dom is overly complicated to work with going through all the nodes and such. what I want is this...


I want to be able to access it like this....

echo($quote->customer[0]->firstname);  //returns bob
echo($quote->customer[1]->firstname); //returns Sally

I ran across some code that did it once before but I lost the link. Also I have similar code for JavaScript. It just seems like a natural way to access XML especially in a loose typed language.  Kinda like it parses the DOM and builds the objects.
LVL 23

Expert Comment

by:Stacy Spear
ID: 18888369
Maybe you were referring to the Php (4 something) function of xml_parse_into_struct()?
LVL 11

Author Comment

ID: 18891634
Nope that's not what I had found it literally converted the XML into a PHP Object structure. Not an array structure.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Calculate values in an array 18 35
Saving image into server to get url later 1 31
MySQL Grouping 2 23
array_values - reorder after unset? 5 12
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…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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 …

895 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

11 Experts available now in Live!

Get 1:1 Help Now