Chris
Chris

Reputation: 33

SimpleXMLElement PHP4

I know SimpleXMLElement doesn't work in PHP4, but is there a something similar I can replace it with to make the script work with PHP 4?

Upvotes: 1

Views: 1866

Answers (3)

troelskn
troelskn

Reputation: 117517

PHP4 had DOM XML and the event-based sax parser. Neither are drop-in replacements for SimpleXml and if I remember correctly, neither were standard, meaning that you need them installed/enabled as extensions. The sax parser also exists on PHP5, so if you want your code to be forward compatible, that is probably the safest bet.

Upvotes: 0

ceejayoz
ceejayoz

Reputation: 180023

PHP5 saw its first release in 2004, and PHP4 end-of-lifed almost exactly a year ago. It's time to move up... and to switch webhosts if your current one doesn't even offer the option.

Upvotes: -1

Pascal MARTIN
Pascal MARTIN

Reputation: 401032

Maybe Ister.org's simplexml44 - PHP4 backport of PHP5 SimpleXML might help you...
Disclaimer : I've never used it at all !

... But I wish you luck : XML-support is one of the "big stuff" that was added in PHP 5...


There were also some XML-related functions/classes in PHP 4 ; but nothing looking like SimpleXML :-(
For instance :


BTW : you should really think about switching to PHP 5 : PHP 4 is not supported anymore, even for security-related bugs !

Did you try your application on a PHP5-enabled server ? If it works, it might allow you to use SimpleXML ;-)
There were some problems switching from PHP 4 to PHP 5 ; but maybe not too many for you application ?

Upvotes: 2

Related Questions