Commit fd95f0c2 by 孙龙

up

parent 8a282fb5
php-simple-html-dom-parser
==========================
Version 1.5.2
Adaptation for Composer and PSR-0 of:
A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way!
Require PHP 5+.
Supports invalid HTML.
Find tags on an HTML page with selectors just like jQuery.
Extract contents from HTML in a single line.
http://simplehtmldom.sourceforge.net/
Install
-------
composer.phar
```json
"require": {
"sunra/php-simple-html-dom-parser": "1.5.2"
}
```
Usage
-----
```php
use Sunra\PhpSimple\HtmlDomParser;
...
$dom = HtmlDomParser::str_get_html( $str );
or
$dom = HtmlDomParser::file_get_html( $file_name );
$elems = $dom->find($elem_name);
...
```
<?php
namespace Sunra\PhpSimple;
require 'simplehtmldom_1_5'.DIRECTORY_SEPARATOR.'simple_html_dom.php';
class HtmlDomParser {
/**
* @return \simplehtmldom_1_5\simple_html_dom
*/
static public function file_get_html() {
return call_user_func_array ( '\simplehtmldom_1_5\file_get_html' , func_get_args() );
}
/**
* get html dom from string
* @return \simplehtmldom_1_5\simple_html_dom
*/
static public function str_get_html() {
return call_user_func_array ( '\simplehtmldom_1_5\str_get_html' , func_get_args() );
}
}
\ No newline at end of file
{
"name": "sunra/php-simple-html-dom-parser",
"type": "library",
"description": "Composer adaptation of: A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.",
"keywords": ["html", "dom", "parser"],
"homepage": "https://github.com/sunra/php-simple-html-dom-parser",
"license": "MIT",
"authors": [
{
"name": "S.C. Chen",
"homepage": "http://sourceforge.net/projects/simplehtmldom/"
},
{
"name": "Sunra",
"email": "sunra@yandex.ru",
"homepage": "https://github.com/sunra"
}
],
"require": {
"php": ">=5.3.2",
"ext-mbstring": "*"
},
"autoload": {
"psr-0": { "Sunra\\PhpSimple\\HtmlDomParser": "Src/" }
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment