Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    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.

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    There are also several third-party backports.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •