PHPackages                             flextype-components/text - 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. flextype-components/text

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

flextype-components/text
========================

Text component is a set of methods to help with the manipulation of strings.

v1.1.2(7y ago)04.7k1MITPHPPHP ^7.1.3

Since Apr 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/flextype-components/text)[ Packagist](https://packagist.org/packages/flextype-components/text)[ Docs](https://github.com/flextype-components/text)[ RSS](/packages/flextype-components-text/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (5)DependenciesVersions (7)Used By (0)

Text Component
==============

[](#text-component)

[![version](https://camo.githubusercontent.com/6cce9d28747e71659e3cbd5d6f495d09a680bdbbd64edbd9ee1eeb6fa826d497/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e312e322d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265 "Version")](https://camo.githubusercontent.com/6cce9d28747e71659e3cbd5d6f495d09a680bdbbd64edbd9ee1eeb6fa826d497/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e312e322d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)[![MIT License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/flextype-components/text/blob/master/LICENSE)

Text Component is a set of methods to help with the manipulation of strings.

### Installation

[](#installation)

```
composer require flextype-components/text

```

### Usage

[](#usage)

```
use Flextype\Component\Text\Text;
```

Translit function to convert text from one script to another.

```
echo Text::translitIt('Привет');
```

Removes any leading and traling slashes from a string

```
echo Text::trimSlashes('some text here/');
```

Reduces multiple slashes in a string to single slashes.

```
echo Text::reduceSlashes('some//text//here');
```

Removes single and double quotes from a string

```
echo Text::stripQuotes('some "text" here');
```

Convert single and double quotes to entities

```
echo Text::quotesToEntities('some "text" here');
```

Creates a random string of characters

```
echo Text::random();
```

Add's string\_1 to a string or increment the ending number to allow string\_2, string\_3, etc

```
$str = Text::increment($str);
```

Cut string

```
echo Text::cut('Some text here', 5);
```

Lowercase

```
echo Text::lowercase('Some text here');
```

Uppercase

```
echo Text::uppercase('some text here');
```

Get length

```
echo Text::length('Some text here');
```

Create a lorem ipsum text

```
echo Text::lorem(2);
```

Extract the last `$num` characters from a string.

```
echo Text::right('Some text here', 4);
```

Extract the first `$num` characters from a string.

```
echo Text::left('Some text here', 4);
```

Replaces newline with `` or ``.

```
echo Text::nl2br("Some \n text \n here");
```

Replaces `` and `` with newline.

```
echo Text::br2nl("Some  text  here");
```

Converts &amp; to &amp;.

```
echo Text::ampEncode("M&CMS");
```

Converts &amp; to &amp;.

```
echo Text::ampDecode("M&amp;CMS");
```

Convert plain text to html

```
echo Text::toHtml('test');
```

Create safe string. Use to create safe usernames or filenames.

```
$safe_string = Text::safeString('hello world');
```

Encrypt string

```
$encrypt_string = Text::encryptString('password', 'string_salt');
```

License
-------

[](#license)

See [LICENSE](https://github.com/flextype-components/text/blob/master/LICENSE)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Recently: every ~64 days

Total

6

Last Release

2685d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/477114?v=4)[Sergey Romanenko](/maintainers/Awilum)[@Awilum](https://github.com/Awilum)

---

Top Contributors

[![Awilum](https://avatars.githubusercontent.com/u/477114?v=4)](https://github.com/Awilum "Awilum (11 commits)")

---

Tags

componentflextypeflextype-componentphptextstringtext

### Embed Badge

![Health badge](/badges/flextype-components-text/health.svg)

```
[![Health](https://phpackages.com/badges/flextype-components-text/health.svg)](https://phpackages.com/packages/flextype-components-text)
```

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[opis/string

Multibyte strings as objects

7120.9M7](/packages/opis-string)[lolli42/finediff

PHP implementation of a Fine granularity Diff engine

138.8M3](/packages/lolli42-finediff)[d4h/finediff

PHP implementation of a Fine granularity Diff engine

141.3M1](/packages/d4h-finediff)[phootwork/lang

Missing PHP language constructs

1224.8M8](/packages/phootwork-lang)[edgaras/strsim

Collection of string similarity and distance algorithms in PHP including Levenshtein, Damerau-Levenshtein, Jaro-Winkler, and more

2423.0k](/packages/edgaras-strsim)

PHPackages © 2026

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