PHPackages                             piyo2/str - 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. piyo2/str

ActiveLibrary

piyo2/str
=========

Normalizing/filtering string

v1.0.0(3y ago)03MITPHPPHP &gt;=7.1.0

Since Oct 27Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

piyo2/str
=========

[](#piyo2str)

Normalizing/filtering string.

Features
--------

[](#features)

- Remove control characters (except for tabs or newlines)
- Normalize Unicode composition sequences
- But keep CJK compatibility ideographs
- Block invalid/overlong UTF-8 sequences
- Transform functions:
    - Uppercase &lt;=&gt; lowercase
    - Zenkaku &lt;=&gt; Hankaku
    - Hiragana &lt;=&gt; Katakana (including ゕ ゖ ゝ ゞ)

Requirements
------------

[](#requirements)

- PHP ≥ 7.1.0
- Intl PHP Extension
- Mbstring PHP Extension

Example
-------

[](#example)

```
$filter = (new Str())->trim()
	->noNewlines()
	->hankakuDigits()
	->hiragana();

$filter->applyTo("　Ａ０３　\nアイス\n");
// => "Ａ03 アイス"
```

Applying user-defined filter:

```
(new Str())->trim()
	->hankaku()
	->fn(fn ($s) => '#' . $s)
	->applyTo('　１２３');
// => "#123"
```

Retain control characters:

```
(new Str())->applyTo("\0\n");
// => "\n"

(new Str(true))->applyTo("\0\n");
// => "\0\n"
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

Unknown

Total

1

Last Release

1299d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2aa0a053807078660f519d4bee9f5219653cd5d730c90b4decd0ab465d3c098e?d=identicon)[sharapeco](/maintainers/sharapeco)

---

Top Contributors

[![sharapeco](https://avatars.githubusercontent.com/u/1665651?v=4)](https://github.com/sharapeco "sharapeco (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/piyo2-str/health.svg)

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

PHPackages © 2026

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