PHPackages                             unreal4u/string-operations - 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. unreal4u/string-operations

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

unreal4u/string-operations
==========================

This class is a collection of functions that deals with strings

v1.1.0(12y ago)3251MITPHPPHP &gt;=5.3.0

Since Dec 27Pushed 11y agoCompare

[ Source](https://github.com/unreal4u/string-operations)[ Packagist](https://packagist.org/packages/unreal4u/string-operations)[ RSS](/packages/unreal4u-string-operations/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (2)Versions (6)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/9e78516b925e0dd8a1e6283e8683fe1c526b6fa1afaed32c73188226c1410ece/68747470733a2f2f706f7365722e707567782e6f72672f756e7265616c34752f737472696e672d6f7065726174696f6e732f762f737461626c652e706e67)](https://packagist.org/packages/unreal4u/string-operations)[![Build Status](https://camo.githubusercontent.com/7a9d54484158ab42bd89e7d00e3ed3938d4fc4640e3b019d82a6c4b6a919fd86/68747470733a2f2f7472617669732d63692e6f72672f756e7265616c34752f737472696e672d6f7065726174696f6e732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/unreal4u/string-operations)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/34431f9f5a1366032c19c7aba6d265223b17400b4ced116936d8f9fe4800fc80/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f756e7265616c34752f737472696e672d6f7065726174696f6e732f6261646765732f7175616c6974792d73636f72652e706e673f733d62646139626666646462643361386662376632343738326334326466643464353765613064326438)](https://scrutinizer-ci.com/g/unreal4u/string-operations/)[![License](https://camo.githubusercontent.com/a2785d5be1cc6eb145c41f9769f4b4d5422c3dbe645f2069c8a5ca3481cb8379/68747470733a2f2f706f7365722e707567782e6f72672f756e7265616c34752f737472696e672d6f7065726174696f6e732f6c6963656e73652e706e67)](https://packagist.org/packages/unreal4u/string-operations)

stringOperations.php
====================

[](#stringoperationsphp)

Credits
-------

[](#credits)

This class is made by unreal4u (Camilo Sperberg). [unreal4u.com/](http://unreal4u.com/)

About this class
----------------

[](#about-this-class)

- Originally conceived to be a receiver of all loose string-related functions that I've made throughout the years
- Later also a playground to learn about multibyte capabilities of strings

Detailed description
--------------------

[](#detailed-description)

This package is a collection of functions related to string manipulation.

Basic usage
-----------

[](#basic-usage)

```
include('src/unreal4u/stringOperations.php');
$stringOperations = new unreal4u\stringOperations();
$result = $stringOperations->truncate('this is a bigger text', 15);
```

- Congratulations! Result will have a truncated string, compatible with UTF-8 characters:

 ```
 this is a bigger...

```

- Please see examples and PHPUnit tests for more options and advanced usage

Composer
--------

[](#composer)

This class has support for Composer install. Just add the following section to your composer.json with:

```
{
    "require": {
        "unreal4u/string-operations": "@stable"
    }
}
```

Now you can instantiate a new stringOperations class by executing:

```
require('vendor/autoload.php');

$stringOperations = new unreal4u\stringOperations();
```

Pending
-------

[](#pending)

- Search for more loose functions spattered around my codebase
- Improve the usage of the internal used charset
- Consistent usage of the class and it subcomponents (UTF-8 in createSlug)
- Multiple arguments for separator in truncate function
- Use transliterate instead of htmlentities (Will produce BC!)

Version History
---------------

[](#version-history)

- 0.1:
    - Created class
- 0.1.1:
    - Documentation fixes
- 0.2.0:
    - Added decomposeCompleteEmail() function and unit tests for it
- 0.2.2:
    - Documentation update
- 0.3.0:
    - Composer compatibility
    - Documentation and examples update
- 0.3.1:
    - Renamed repo and moved PHPUnit as dependency
- 0.3.2:
    - Travis-CI support
    - Gitattributes
    - Documentation fixes
- 1.0.0:
    - Truncate function improvements and BC breaks
        - This function can now search backwards in the string
        - This function now supports multiple separators
    - Excluded some things from the auto generated release packages
- 1.1.0:
    - Class doesn't rely anymore on imap functions, so no more need for imap extension!
    - Update to PHPUnit 4.0
    - Added PHP 5.3 to the battery test

Contact the author
------------------

[](#contact-the-author)

- Twitter: [@unreal4u](http://twitter.com/unreal4u)
- Website:
- Github:

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

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

Total

5

Last Release

4429d ago

Major Versions

v0.3.2 → v1.0.02014-03-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/43792f8b224d7de339a848cd799635fa8e062eea3fb669e3ca7a1d1e2cff756d?d=identicon)[unreal4u](/maintainers/unreal4u)

---

Top Contributors

[![unreal4u](https://avatars.githubusercontent.com/u/194999?v=4)](https://github.com/unreal4u "unreal4u (41 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/unreal4u-string-operations/health.svg)

```
[![Health](https://phpackages.com/badges/unreal4u-string-operations/health.svg)](https://phpackages.com/packages/unreal4u-string-operations)
```

###  Alternatives

[pocketmine/math

PHP library containing math related code used in PocketMine-MP

45573.2k14](/packages/pocketmine-math)[nathancox/minify

Minifies CSS requirements using Minify (http://code.google.com/p/minify/)

28143.4k1](/packages/nathancox-minify)

PHPackages © 2026

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