simplehtmldom A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way!

  1. OVERVIEW
  2. USAGE
  3. RESOURCE

OVERVIEW

  • A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way!
  • Supports invalid HTML.
  • Find tags on an HTML page with selectors just like jQuery.
  • Extract contents from HTML in a single line.

USAGE

Yii::import('ext.SimpleHTMLDOM.SimpleHTMLDOM');
// Create DOM from URL or file
$simpleHTML = new SimpleHTMLDOM;
$html = $simpleHTML->file_get_html('http://www.google.com/');

// Find all images
foreach($html->find('img') as $element)
       echo $element->src . '<br>';

// Find all links
foreach($html->find('a') as $element)
       echo $element->href . '<br>'; 

RESOURCE

http://simplehtmldom.sourceforge.net/

7 3
14 followers
2 346 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Others
Developed by: nucreativa
Created on: Oct 31, 2012
Last updated: 5 years ago

Downloads

show all