Package Data | |
---|---|
Maintainer Username: | fahmiardi |
Maintainer Contact: | i@yangqi.me (yangqi) |
Package Create Date: | 2015-05-06 |
Package Last Update: | 2015-05-06 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-09 15:01:41 |
Package Statistics | |
---|---|
Total Downloads: | 1,186 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 1 |
Total Open Issues: | 0 |
A Htmldom package for Laravel 4 and 5 based on Simple HTML Dom Parser
Add the following line to the require
section of composer.json
:
{
"require": {
"yangqi/htmldom": "dev-master"
}
}
config/app.php
.'providers' => array(
...
'Yangqi\Htmldom\HtmldomServiceProvider',
...
config/app.php
.'aliases' => array(
...
'Htmldom' => 'Yangqi\Htmldom\Htmldom',
...
$html = new \Htmldom('http://www.example.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>';
See the detailed documentation http://simplehtmldom.sourceforge.net/manual.htm