1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Array <-> XML?

Discussion in 'PHP' started by Triexa, May 30, 2007.

  1. #1
    Does anybody have any code that parses an xml to an array, or vice versa? That works in PHP 4+

    OR is there any XML library/extension/whatever that I'm not aware of that works just fine in both PHP 4 and 5?

    OR, ignoring arrays, is there a way to work with XMLs in both PHP 4 and 5?
     
    Triexa, May 30, 2007 IP
  2. speda1

    speda1 Well-Known Member

    Messages:
    374
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Take a look at the simplexml functions. They are usually installed and easy to use.
    php.net/simplexml
     
    speda1, May 30, 2007 IP
  3. speda1

    speda1 Well-Known Member

    Messages:
    374
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Sorry, need PHP5.
     
    speda1, May 30, 2007 IP
  4. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #4
    Use DOM XML functions

    If you want something ready to use, search "php array to xml" in google, here is something I found:
    phpclasses.org/browse/file/6211.html
    (sorry, you have to copy paste as I cannot post "live links")
     
    krt, May 30, 2007 IP