#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    65
    Rep Power
    15
    Hi, every body.....

    I have one file call content.xml (example)and inside got...

    <xml version="1.0">
    <Books>
    <book>
    <title>PHP And You</title>
    <price>$199.99</price>
    <author>Some one</author>
    <isdn>asd1234-89009</isnd>
    </book>
    <book>
    <title>Visual Basic</title>
    <price>$99.99</price>
    <author>King kong</author>
    <isdn>asd4567-34590</isnd>
    </book>
    <book>
    <title>JS Expert</title>
    <price>$149.99</price>
    <author>JS</author>
    <isdn>js85434-6679</isnd>
    </book>
    </Books>

    how can i read the file and print the book title,price,author and isdn without the tag(<element>.....</element>

    I need your help please, thanks first.....
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    ereg("<title>(.*)</title>",$string,$newstring );

    But first you need to read the whole file - stripout the useless stuff and then explode the items to an array.

    I have just done a parser for the devshednews.rdf and thats pretty much the way I did that.

    Simon


    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL

Similar Threads

  1. Replies: 1
    Last Post: December 20th, 2003, 01:22 PM
  2. unable to parse xml using servlet
    By babloosony in forum Java Help
    Replies: 2
    Last Post: December 8th, 2003, 07:40 AM
  3. compile vhosts
    By the-griff in forum Linux Help
    Replies: 0
    Last Post: November 5th, 2003, 09:07 PM
  4. PHP XML Parsing
    By iwarner in forum PHP Development
    Replies: 0
    Last Post: November 4th, 2003, 07:01 AM
  5. How can I parse Word Documents and export to XML??
    By Westside in forum XML Programming
    Replies: 1
    Last Post: October 27th, 2003, 05:35 AM

IMN logo majestic logo threadwatch logo seochat tools logo