Results 1 to 3 of 3

Thread: Help me. Parsing html documents with php

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Posts
    75

    Help me. Parsing html documents with php

    Hello,
    I need to parse html documents to get "values" of all html tags and their attributes like if I have:
    <a href="url_here" title="title_here"> text_here </a>
    Then I need 3 values of:
    array(
    'href' => 'url_here',
    'title' => 'title_here',
    'tag_value' => 'text_here'
    );
    How to do this?
    Please let me know. If possible please give me some code.
    regards
    Thank you

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Help me. Parsing html documents with php

    You could use the DOM Extension to load the HTML document into a DOM tree and then traverse that through code.

  3. #3
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Help me. Parsing html documents with php

    Are you looking to do this for all tags or just selective tags as listed above?
    My Blog.

    Ryan Jones.

Posting Permissions

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



Click Here to Expand Forum to Full Width