A class thats transforms a String containing HTML code into an Array

Discussion in 'PHP' started by astkboy2008, Jan 4, 2010.

  1. #1
    Hello every one agian
    today i got new class by Ciprian Mocanu <http://mbe.ro> <ciprian@mbe.ro>
    :D
    The PHP class takes a string containing HMTL code and parses it to an array as good as possible (it tries to do its best even if the code is malformed). The class works inverse than others. It parses from the simplest HTML tags to the complex ones. It works fairly fast. It has the option to ignore single tags (such as meta tags, img tags and so on).
    simple example
    $html = file_get_contents('http://www.google.com');
    $parser = new htmlParser($html);
    $ar = $parser->toArray();
    var_dump($ar);
    
    PHP:
    How Can I Install?
    Simply copy it to wherever you like and include it in your script.


     
    astkboy2008, Jan 4, 2010 IP
  2. Izonedig

    Izonedig Member

    Messages:
    150
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #2
    I advise you to use html dom class; it works well with html parsing and easy to install.... http://simplehtmldom.sourceforge.net/
    I don't know about this class in your post.

    By the way, I like your website (in your sig) :) . I sent you PM, please check it.
     
    Izonedig, Jan 4, 2010 IP
  3. astkboy2008

    astkboy2008 Peon

    Messages:
    211
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks you is great man and your blog has amazing feature
    and i know html dom class its very good
     
    astkboy2008, Jan 4, 2010 IP