PHPackages                             whero/simple-html - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. whero/simple-html

ActiveLibrary

whero/simple-html
=================

一款类似于Jquery语法的HTML DOM解析扩展包

1.0(8y ago)182PHP

Since Nov 30Pushed 8y agoCompare

[ Source](https://github.com/aizxin/simple-html)[ Packagist](https://packagist.org/packages/whero/simple-html)[ Docs](https://github.com/aizxin/SimpleHtml)[ RSS](/packages/whero-simple-html/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

SimpleHtml
==========

[](#simplehtml)

一款PHP语言开发的HTML DOM解析插件，语法类似于Jquery，基于[simplehtmldom](http://simplehtmldom.sourceforge.net/)做了命名空间的封装。

安装
--

[](#安装)

```
    composer require whero/simple-html  或者  composer require whero/simple-html dev-master

```

使用
--

[](#使用)

```
//字符串加载
$html = \SimpleHtml\SimpleHtml::str_get_html(''从字符串中加载html文档演示'');
//URL加载
$html = \SimpleHtml\SimpleHtml::str_get_html('https://baidu.com');
//文件加载
$html = \SimpleHtml\SimpleHtml::str_get_html('/tmp/baidu.html');

//查找html文档中的超链接元素
$a = $html->find('a');

//查找文档中第(N)个超链接，如果没有找到则返回空数组.
$a = $html->find('a', 0);

// 查找id为main的div元素
$main = $html->find('div[id=main]',0);

// 查找所有包含有id属性的div元素
$divs = $html->find('div[id]');

// 查找所有包含有id属性的元素
$divs = $html->find('[id]');

//清除使用
$html->clear();

// 调用
$html = \SimpleHtml\HtmlDom::getInit();
$content = $html->strHtml(''从字符串中加载html文档演示从字符串中加载html文档演示'');
```

更多使用语法
------

[](#更多使用语法)

- [simPHP Simple HTML DOM Parser Wiki](http://simplehtmldom.sourceforge.net/manual.htm)
- [PHP Simple HTML DOM解析器使用入门](http://www.cnphp.info/php-simple-html-dom-parser-intro.html)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3088d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/739c762ff003ba92e9cb0fa7fb92048fedd3c25c29c7d4c7354a3b235002e82e?d=identicon)[aizxin](/maintainers/aizxin)

---

Top Contributors

[![aizxin](https://avatars.githubusercontent.com/u/22167719?v=4)](https://github.com/aizxin "aizxin (3 commits)")

### Embed Badge

![Health badge](/badges/whero-simple-html/health.svg)

```
[![Health](https://phpackages.com/badges/whero-simple-html/health.svg)](https://phpackages.com/packages/whero-simple-html)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
