PHPackages                             yng/yng-helper - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. yng/yng-helper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yng/yng-helper
==============

The YNGPHP Helper Package

035PHP

Since Sep 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/yng666/yng-helper)[ Packagist](https://packagist.org/packages/yng/yng-helper)[ RSS](/packages/yng-yng-helper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

YngHelper
=========

[](#ynghelper)

基于PHP7.1+

安装
--

[](#安装)

```
composer require yng/yng-helper
```

#### 字符串用法

[](#字符串用法)

```
use Yng\Helper\Str;
// 检查字符串中是否包含某些字符串
Str::contains($haystack, $needles)

// 检查字符串是否以某些字符串结尾
Str::endsWith($haystack, $needles)

// 获取指定长度的随机字母数字组合的字符串
Str::random($length = 16)

// 字符串转小写
Str::lower($value)

// 字符串转大写
Str::upper($value)

// 获取字符串的长度
Str::length($value)

// 截取字符串
Str::substr($string, $start, $length = null)
```

#### 数组用法

[](#数组用法)

```
use Yng\Helper\Arr;
//模型查询的结果也为真
Arr::accessible($value);

Arr::add($array, $key, $value);
//如下操作
$arr  = [];
$arr = Arr::add($arr,'name.66.aaa','yngphp'); //本行结果$arr['name'][66]['aaa'] = 'yngphp'
Arr::add($arr,'name','yngphp_哈哈哈');//本行不会产生影响,因为'name'已存在.

// 将数据集管理类转换为数组
Arr::collapse($array);

// 排列数组组合
$arr = Arr::crossJoin(['dd'],['ff'=>'gg'],[2],[['a'=>'mm','kk'],'5']);//上面行没有什么意义,但是可以看到该函数的作用,数组索引被忽略,数组得值被全部组合
$arr = Arr::crossJoin(['a','b','c'],['aa','bb','cc','dd']);//这一行可以看到组合的效果,返回一个二维数组,第二维每个数组是的给定值排列,比如(a,aa),(a,bb),(a,cc)...直到(c,dd)
```

更多的用法请参考源码

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/96970b9790e831710268790f4260e41e5d2c67de273a1f9502a1729fbc47df4f?d=identicon)[yng666](/maintainers/yng666)

---

Top Contributors

[![yng666](https://avatars.githubusercontent.com/u/104509400?v=4)](https://github.com/yng666 "yng666 (7 commits)")

### Embed Badge

![Health badge](/badges/yng-yng-helper/health.svg)

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

###  Alternatives

[epigra/trstringhelper

PHP Türkçe Karakter Destekli String Fonksiyonları (toupper,tolower,ucfirst,ucwords,capitalizefirst) Kütüphanesi

244.1k](/packages/epigra-trstringhelper)

PHPackages © 2026

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