...

View Full Version : replacing simplexml function



danny251
08-09-2008, 01:26 AM
I need to replace simplexml_load_file() as I don't have the latest PHP installation on my host sao does anyone have a suggerstion?
cheers

Inigoesdr
08-09-2008, 03:21 AM
Get a new host. SimpleXML is enabled by default on PHP5.. you have to specifically disable it if you don't want to use it, and there should be no serious reason you would need to disable it.

Alternatively, you can try some of the other XML extensions (http://php.net/refs.xml) available with PHP, or look for one that suits your needs in the PEAR repository (http://pear.php.net/search.php?q=xml&in=packages).

Fou-Lu
08-09-2008, 04:48 AM
The best part about XML is its required well-formed nature. Worst comes to worst, you can create you're own XML handling. I have done this once on PHP4, but as soon as I could use (I think it was) the DOMXML library I dumped the ones I created. Why reinvent the wheel.
I don't have this code anymore, but I recall it being simple pattern matching. It did require a full load of the file so it wouldn't work if the file was too large to handle (at the time, about 64mb in size).
As Indegoesdr mentioned, there are a lot of XML handling functions in PHP.

If you're on PHP4, you'll be looking at DOMXML - you'll need the libxml library if I'm not mistaken to use it. If you're on PHP5, look into the DOM - simplexml can be converted to and from DOM if I'm not mistaken. DOM is also enabled by default in PHP5, but can also be disabled.

Inigoesdr
08-09-2008, 05:59 PM
There are also several third-party backports (http://www.google.com/search?hl=en&q=simplexml+for+php4&btnG=Google+Search).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum