Using XML with PHP

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Using XML with PHP

Post by kendall »

Hey,

I am developing a framework to use personally to build web pages and I want to use XML markup as a means of storing some static information. My question for advice comes from the use of PHP's XML capabilities. Via the documentation I see that different versions of PHP have different libraries and I was wondering if using XML still makes sense given that I usually work with PHP 4.3 - 5.2 at the moment and there are different libraries based on version.

Has anyone been able to use XML across the board for the versions of PHP?
Which library is satisfactory enough to use as part of a framework design?
AntonioCS
Forum Newbie
Posts: 11
Joined: Tue Jan 15, 2008 12:31 pm

Re: Using XML with PHP

Post by AntonioCS »

If it's php like arrays or classes use var_export and serialize/unserialize to store them. No need for xml :)
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Re: Using XML with PHP

Post by kendall »

AntonioCS wrote:If it's php like arrays or classes use var_export and serialize/unserialize to store them. No need for xml :)
I have tried the array thing and i find it a bit cumbersome. I'm also thinking about how easy it would be between PHP & Js as there wouldnt be that much effort to transport the between the two.
AntonioCS
Forum Newbie
Posts: 11
Joined: Tue Jan 15, 2008 12:31 pm

Re: Using XML with PHP

Post by AntonioCS »

To transport between js and php use json. Php has already built in functions and there are js libs that can convert js arrays to json and back
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Re: Using XML with PHP

Post by kendall »

AntonioCS wrote:To transport between js and php use json. Php has already built in functions and there are js libs that can convert js arrays to json and back
I guess you maybe right with this one. thanks
Post Reply