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

ActiveLibrary

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

K92 utility php lib

v2.1.0(1y ago)2211MITPHP

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 1mo 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 68% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity9

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

537d ago

Major Versions

v1.9.2 → v2.0.02023-03-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/a8f976ca090981bb419fdeb7c59cae14e790d994676ff7ecdc2fdf62d1ff4e5b?d=identicon)[kocoten1992](/maintainers/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.7k509.9M17.0k](/packages/laravel-framework)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[illuminate/support

The Illuminate Support package.

582107.1M34.5k](/packages/illuminate-support)[aimeos/aimeos-core

Full-featured e-commerce components for high performance online shops

4.5k346.9k48](/packages/aimeos-aimeos-core)[voku/portable-utf8

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

52322.4M40](/packages/voku-portable-utf8)

PHPackages © 2026

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