PHPackages                             sfneal/string-helpers - 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. sfneal/string-helpers

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

sfneal/string-helpers
=====================

PHP string helper functions that add familiar functionality from other languages (like string contains, splitting, truncating, etc...)

1.2.4(4y ago)3148.7k10MITPHPPHP &gt;=7.1CI failing

Since Aug 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/sfneal/string-helpers)[ Packagist](https://packagist.org/packages/sfneal/string-helpers)[ Docs](https://github.com/sfneal/string-helpers)[ RSS](/packages/sfneal-string-helpers/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (4)Versions (27)Used By (10)

String Helpers
==============

[](#string-helpers)

[![Packagist PHP support](https://camo.githubusercontent.com/19d726673af5c0ff41e7bb8abad650ff659387b1a46de4a7cf1b380f8937387b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73666e65616c2f737472696e672d68656c70657273)](https://packagist.org/packages/sfneal/string-helpers)[![Latest Version on Packagist](https://camo.githubusercontent.com/f1330b58b74a9bce2af6af17b698a5b2fdbe79538de9aa738cdaff1b1bcf2296/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73666e65616c2f737472696e672d68656c706572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sfneal/string-helpers)[![Build Status](https://camo.githubusercontent.com/c836c20426cbd3e912c074a6fd45c0a03f5f568a6fa505bfa90183c7962082b4/68747470733a2f2f7472617669732d63692e636f6d2f73666e65616c2f737472696e672d68656c706572732e7376673f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://travis-ci.com/sfneal/string-helpers)[![StyleCI](https://camo.githubusercontent.com/c4e3b8ea8a0821c930837433a0ac5dacd43c0dbbbbd737bc629f2a9d7f797d78/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3238383738373639352f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/288787695?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a52391a4249536b90a1f1a2d280cddb47ba29fa8a56e4a0509ee8da4c460cfa0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73666e65616c2f737472696e672d68656c706572732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sfneal/string-helpers/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/24f5c3ebcd4ce90f6fadeb057a1d3c5a117688712c79de640f4fa6c4759c4c93/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73666e65616c2f737472696e672d68656c706572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sfneal/string-helpers)

PHP string helper functions that add familiar functionality from other languages (like string contains, splitting, truncating, etc...)

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

[](#installation)

You can install the package via composer:

```
composer require sfneal/string-helpers
```

In order to autoload to the helper functions add the following path to the autoload.files section in your composer.json.

```
"autoload": {
    "files": [
        "vendor/sfneal/string-helpers/src/strings.php"
    ]
},
```

Usage
-----

[](#usage)

Example use of the 'truncate' helper and method.

```
# using StringHelpers import
use Sfneal\Helpers\Strings\StringHelpers;
(new StringHelpers("here is a long string we'd like to truncate"))->truncate(12);
>>> here is a lo...

# using autloaded helpers
truncateString("here is a long string we'd like to truncate", 12);
>>> here is a lo...
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Stephen Neal](https://github.com/sfneal)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

PHP Package Boilerplate
-----------------------

[](#php-package-boilerplate)

This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity60

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

Recently: every ~82 days

Total

26

Last Release

1474d ago

Major Versions

0.4.1 → 1.0.02021-01-20

PHP version history (3 changes)0.1.0PHP ^7.1

0.2.0PHP &gt;=7.0

0.4.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec5fdf3b9d2183ae9c777e4aed46fd5cfd9aa4789cd05c669e5907de0b8c865c?d=identicon)[sfneal](/maintainers/sfneal)

---

Top Contributors

[![sfneal](https://avatars.githubusercontent.com/u/23200215?v=4)](https://github.com/sfneal "sfneal (150 commits)")

---

Tags

String helperssfneal

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sfneal-string-helpers/health.svg)

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

###  Alternatives

[rappasoft/laravel-helpers

Laravel Helpers for Non-Laravel Projects

277681.9k22](/packages/rappasoft-laravel-helpers)

PHPackages © 2026

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