PHPackages                             bbear/tools - 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. bbear/tools

ActiveLibrary

bbear/tools
===========

Some simple method for often use

v0.1.2(7y ago)0652MITPHPPHP &gt;=5.4.0

Since Nov 22Pushed 7y ago1 watchersCompare

[ Source](https://github.com/hululidexiong/tools)[ Packagist](https://packagist.org/packages/bbear/tools)[ RSS](/packages/bbear-tools/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (4)Used By (2)

Tools 功能组件含如下静态方法：
------------------

[](#tools-功能组件含如下静态方法)

1. 判断为空 isEmpty
2. 分转换元 beforePrice 说明：返回值 乘 100
3. 元转换分 lastPrice 说明：值 除 100 保留两位小数（末位会因精度导致四舍五入）
4. 保留小数两位 （末位会因精度导致四舍五入） float2
5. 分页 page
6. 多结果分页 multiPage
7. 按计时方式显示时间 secondToWords
8. 验证是索引数组 is\_indexArray
9. 对称加密方法 sEncode
10. 对称解密方法 sDecode

isEmpty 接受一个值 同 empty不同的是 这个方法不会验证 0 page 分页 如下：

```

        接收三个参数 int $count , int $page  , int $pagesize
        print_r( Tools::page(50 , 1) );

```

multiPage 等于page的升级版至此多结果集分页：

```

        除第一个参数是数组 其他与page相同
        $C = array();
        $C[] =  12;
        $C[] = 4;
        $C[] = 20;
        $C[] = 5;
        print_r( Tools::multiPage($C , 1 , 50) );

```

secondToWords( second ) 接收一个 int 参数 返回：按计时方式显示时间 如：3分45秒

is\_indexArray 验证数组是索引数组

Installation
------------

[](#installation)

> 使用composer 安装

```
composer require "bbear/tools"
```

Usage
-----

[](#usage)

```
    use BBear\Tools\Base\Tools;
    $str = '~!@#$%^&*()_+  asdasdzxc啊哦哦';
    $enStr = Tools::sEncode($str);
    $deStr = Tools::sDecode($enStr);
    echo $str . "\n";
    echo $enStr . "\n";
    echo $deStr . "\n";
    var_dump( $str === $deStr);
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

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 ~97 days

Total

3

Last Release

2902d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/bbear-tools/health.svg)

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

PHPackages © 2026

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