PHP Classes

File: system/modules/domparser/info.xml

Recommend this page to a friend!
  Classes of Mihajlo Siljanoski  >  Xmodule  >  system/modules/domparser/info.xml  >  Download  
File: system/modules/domparser/info.xml
Role: Example script
Content type: text/plain
Description: Example script
Class: Xmodule
Modular Web application development framework
Author: By
Last change:
Date: 5 years ago
Size: 1,268 bytes


Class file image Download
    <name>Simple Dom Parser <small>(ver. 2.0+)</small></name>
    <description>A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way!<br/>Require PHP 5+<br/>Supports invalid HTML.<br/>Find tags on an HTML page with selectors just like jQuery.<br/>Extract contents from HTML in a single line.</description>
        <init>$parser = module('domparser');</init>
        <return>$parser will return object with methods 'file_get_html' and 'str_get_html'.<br /><br />Full documentation on this link: <a href="" target="_blank"></a></return>
//loading module
$parser = module('domparser');

//fatching html from url

//finding div with id with value 'headerwrap', finding inside first h2 tag and innerHTML
echo $parser->html->find('div[id=headerwrap]',0)->find('h2',0)->innertext;
    <name>S.C. Chen, John Schlick, Rus Carroll</name>

For more information send a message to info at phpclasses dot org.