Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-09-2008, 01:26 AM   PM User | #1
danny251
New to the CF scene

 
Join Date: Nov 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
danny251 is an unknown quantity at this point
replacing simplexml function

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
danny251 is offline   Reply With Quote
Old 08-09-2008, 03:21 AM   PM User | #2
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
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 available with PHP, or look for one that suits your needs in the PEAR repository.

Last edited by Inigoesdr; 08-09-2008 at 03:23 AM..
Inigoesdr is offline   Reply With Quote
Old 08-09-2008, 04:48 AM   PM User | #3
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Old 08-09-2008, 05:59 PM   PM User | #4
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
There are also several third-party backports.
Inigoesdr is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:34 PM.


Advertisement
Log in to turn off these ads.