Page 1 of 1

Using XML with PHP

Posted: Tue Jan 05, 2010 11:58 am
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?

Re: Using XML with PHP

Posted: Sat Jan 09, 2010 8:42 am
by AntonioCS
If it's php like arrays or classes use var_export and serialize/unserialize to store them. No need for xml :)

Re: Using XML with PHP

Posted: Sat Jan 09, 2010 4:05 pm
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.

Re: Using XML with PHP

Posted: Sun Jan 10, 2010 12:54 pm
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

Re: Using XML with PHP

Posted: Sun Jan 10, 2010 1:28 pm
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