PHP read certain string

Discussion in 'PHP' started by hostrs.com, Aug 28, 2009.

  1. #1
    Hey. I was to read from an xml file with php.
    Lets say i was to read from string "<xml>"
    all the way to "</xml>". I need all the contents inside that. How can i do that. I need something that will read from one string to another. thanks
     
    hostrs.com, Aug 28, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    preg_match('/<xml>(.*?)<\/xml>/i', $contents, $match);
     
    premiumscripts, Aug 29, 2009 IP
  3. maneetpuri

    maneetpuri Active Member

    Messages:
    152
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #3
    maneetpuri, Aug 29, 2009 IP