PHPackages                             php127/websiteinfo - 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. php127/websiteinfo

ActiveLibrary

php127/websiteinfo
==================

从html代码中分析网站信息

v1.1.2(4y ago)014.4kMITPHPPHP &gt;=7.3

Since Feb 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/aa24615/websiteinfo)[ Packagist](https://packagist.org/packages/php127/websiteinfo)[ RSS](/packages/php127-websiteinfo/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (3)Versions (6)Used By (0)

php127/websiteinfo
==================

[](#php127websiteinfo)

从html代码中分析网站信息

- 获取网站名称
- 获取网站title
- 获取网站keywords
- 获取网站description
- 获取网站logo
- 获取网站icon
- 获取网站ICP备案号
- 获取网站公安备案号
- 获取网站联系QQ
- 获取网站联系微信
- 获取网站联系邮箱
- 网站是否使用cnzz统计
- 网站是否使用百度统计
- 网站是否使用51.la统计

要求
--

[](#要求)

1. php &gt;= 7.3
2. Composer

安装
--

[](#安装)

```
composer require php127/websiteinfo -vvv
```

用法
--

[](#用法)

```
use Php127\WebsiteInfo;

$str = file_get_contents('http://www.test.com');

$webinfo = new WebsiteInfo($str);
```

获取所有信息

```
$webinfo->get();

/*
Array
(
    [name] => 网站名称
    [title] => test标题
    [keywords] => test关健词
    [description] => test描述
    [logo] => Array
        (
            [0] => https://www.test.com/images/logo.svg
            [1] => https://www.test.com/images/logo.svg
        )

    [icon] =>
    [qq] => Array
        (
            [0] => 1231230
        )

    [beian] => 沪ICP备202xxx722号-1
    [security] => 皖公网安备 340xxx000334号
    [isCnzzTongji] =>
    [isBaiduTongji] => 1
    [isWuyilaTongji] => 1
)
*/
```

单个获取

```
//获取网站名称
$webinfo->getName();

//获取网站title
$webinfo->getTitle();

//获取网站keywords
$webinfo->getKeywords();

//获取网站description
$webinfo->getDescription();

//获取网站logo
$webinfo->getLogo();

//获取网站icon
$webinfo->getIcon();

//获取网站ICP备案号
$webinfo->getBeian();

//获取网站公安备案号
$webinfo->getSecurity();

//获取网站联系QQ
$webinfo->getQQ();

//获取网站联系微信
$webinfo->getWeixin();

//获取网站联系邮箱
$webinfo->getEmail();

//网站是否使用cnzz统计
$webinfo->isCnzzTongji();

//网站是否使用百度统计
$webinfo->isBaiduTongji();

//网站是否使用51.la统计
$webinfo->isWuyilaTongji();
```

重新设置html

```
$str = file_get_contents('http://www.test2.com');

//当同时分析多个页面时,无需再次new WebsiteInfo
$webinfo->setHtml($str);
$webinfo->getLogo();
//...
```

参与贡献
----

[](#参与贡献)

1. fork 当前库到你的名下
2. 在你的本地修改完成审阅过后提交到你的仓库
3. 提交 PR 并描述你的修改，等待合并

> 注: 本项目同时发布在gitee 请使用github提交
> github:

License
-------

[](#license)

[MIT license](https://opensource.org/licenses/MIT)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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

Every ~50 days

Total

5

Last Release

1708d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fbcdf7ec634eb735375fa4f6046f91646934f9eb07456f4b4dcbdec545c6435b?d=identicon)[aa24615](/maintainers/aa24615)

---

Top Contributors

[![aa24615](https://avatars.githubusercontent.com/u/33275679?v=4)](https://github.com/aa24615 "aa24615 (13 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/php127-websiteinfo/health.svg)

```
[![Health](https://phpackages.com/badges/php127-websiteinfo/health.svg)](https://phpackages.com/packages/php127-websiteinfo)
```

PHPackages © 2026

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