PHPackages                             k92/phputils - 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. k92/phputils

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

k92/phputils
============

K92 utility php lib

v2.1.0(1y ago)2221MITPHPCI failing

Since Apr 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kocoten1992/phputils)[ Packagist](https://packagist.org/packages/k92/phputils)[ RSS](/packages/k92-phputils/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (4)Versions (23)Used By (1)

PHPUTILS
========

[](#phputils)

phputils is a share utility library

Usage
-----

[](#usage)

```
use K92\Phputils\StrUtil;

// normal case
str_replace([1, 2], [2, 3], '12');                            // '33'
StrUtil::replaceOnce([1, 2], [2, 3], '12');                   // '23'
str_replace(['1', '0'], ['x110x2', 'x010'], 'a1b0c')          // 'ax11x010x2bx010c'
StrUtil::replaceOnce(['1', '0'], ['x110x2', 'x010'], 'a1b0c') // 'ax110x2bx010c'

// edge case
str_replace([12, 23], [23, 45], '123') // '453'
StrUtil::replaceOnce([12, 23], [23, 45], '123') // false
str_replace([12, 23], [23, 45], '1223') // '4545'
StrUtil::replaceOnce([12, 23], [23, 45], '1223') // false
```

Requirement
-----------

[](#requirement)

Need mbstring extension

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

[](#installation)

Use the package manager [composer](https://getcomposer.org/) to install phputils.

```
composer require k92/phputils
```

Testing
-------

[](#testing)

```
./vendor/bin/phpunit tests
```

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Recently: every ~118 days

Total

22

Last Release

584d ago

Major Versions

v1.9.2 → v2.0.02023-03-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7130705?v=4)[Chuong](/maintainers/kocoten1992)[@kocoten1992](https://github.com/kocoten1992)

---

Top Contributors

[![kocoten1992](https://avatars.githubusercontent.com/u/7130705?v=4)](https://github.com/kocoten1992 "kocoten1992 (27 commits)")

---

Tags

php

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/k92-phputils/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[illuminate/support

The Illuminate Support package.

630113.0M41.3k](/packages/illuminate-support)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M986](/packages/statamic-cms)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[voku/portable-utf8

Portable UTF-8 library - performance optimized (unicode) string functions for php.

52323.5M49](/packages/voku-portable-utf8)

PHPackages © 2026

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