View Full Version : XML with PHP?
guvenck
08-06-2006, 11:57 PM
Hi, I am new to XML and would like to try using XML with PHP. I'd like to start using it instead of a MySQL DB. Are there any examples here or on the web?
The Reverend
08-07-2006, 12:30 AM
I've just started trying to blend the two myself, here's a good place to start.
http://us2.php.net/xml
check out simplexml too.
http://us2.php.net/simplexml
dreamnet
08-27-2006, 07:53 PM
I think you can try json
cdc08x
08-30-2006, 10:11 AM
I'm glad you're starting this kind of interaction.
But watch out: packages for this interaction are new somehow, then keep in mind that maybe something could not run on older versions of PHP.
I mean: PHP 5 includes a native module called "SimpleXML", that was not included in PHP 4 (and many web hosting services support only PHP 4). On the other side, PHP 4 supported DOMXML (very close to SimpleXML), which is not included anymore in PHP5.
Both versions include SAX (Simple API for XML). It does not treat the DOM Document as a tree, it's a procedural-like API that is event-driven: every check that reveals a tag opening, a tag content, or a tag closing, fires an event, that you have to manage with a callback function to define by yourself.
Personally, I've always used SAX. But I must admit that SimpleXML is much more comfortable!
Consider the opportunity (if you want to transpose XML in XHTML directly, for example) to use the brand new (experimental in PHP 4, included in PHP 5 only) XSLT-module!
Cheers
Zipp425
09-11-2006, 08:05 AM
Thank you so much for the mention of SimpleXML, I didnt even know it existed, so for a huge project involving PHP, Javascript, and XML, I was just using fopen and having to select a specific line to replace...
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.