Parse an html file

Discussion in 'PHP' started by ma0, Mar 13, 2007.

  1. #1
    Hi, I'd like to read an html file from a site and take out some information, what is the best way to do that? To get the single information I was thinking to read inside strings and get every single word I need, hoping that tags are closed in the right way..or maybe I should look for something like a xml parser that creates object from the html file?

    thanks
     
    ma0, Mar 13, 2007 IP
  2. rays

    rays Active Member

    Messages:
    563
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #2
    I hope this code will help you
     
    rays, Mar 13, 2007 IP
    ma0 likes this.
  3. ma0

    ma0 Peon

    Messages:
    218
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks! I will try both tonight.
    :)
     
    ma0, Mar 13, 2007 IP
  4. jitesh

    jitesh Peon

    Messages:
    81
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    $lines = file(strip_tags('http://www.example.com/'));
     
    jitesh, Mar 13, 2007 IP
    ma0 likes this.