zvook/php5-simple-html

Wrapper for simple_html_dom

1.2.0 2016-04-19 12:44 UTC

This package is not auto-updated.

Last update: 2024-11-09 19:45:35 UTC


README

Usable wrapper for simple_html_dom

Makes you happy to use simple_html_dom with your IDE

Usage

Add to your composer.json

"require": {
    "zvook/php5-simple-html": "*"
}

Example

use SimpleHtml\Dom;

$dom = Dom::str_get_html('<html></html>');
$dom = Dom::file_get_html('http://www.google.com/');

$div = $dom->getElementById('id1');
foreach ($div->getElementByTagName('table.table-class')->find('tr') as $row) {
    $firstCell = $row->find('td', 0);
    $thirdCell = $row->find('td', 2);
    $content = $thirdCell->plaintext;
}