PHPackages                             alexskrypnyk/str2name - 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. alexskrypnyk/str2name

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

alexskrypnyk/str2name
=====================

Convert strings to named formats

1.4.1(5mo ago)123.0k↓24.3%[1 issues](https://github.com/AlexSkrypnyk/Str2Name/issues)GPL-2.0-or-laterPHPPHP &gt;=8.2CI passing

Since May 16Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/AlexSkrypnyk/Str2Name)[ Packagist](https://packagist.org/packages/alexskrypnyk/str2name)[ Docs](https://github.com/alexskrypnyk/str2name)[ GitHub Sponsors](https://github.com/alexskrypnyk)[ Patreon](https://www.patreon.com/alexskrypnyk)[ RSS](/packages/alexskrypnyk-str2name/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (7)Versions (10)Used By (0)

  ![Str2Name logo](https://camo.githubusercontent.com/795a23d8d17a0f9b08fff74068f9851d6c9244b1df999e831b205284bc0756e8/68747470733a2f2f706c616365686f6c642e6a702f3030303030302f6666666666662f323030783230302e706e673f746578743d537472324e616d65266373733d253742253232626f726465722d7261646975732532322533412532322532303130307078253232253744)

Convert strings to named formats
================================

[](#convert-strings-to-named-formats)

[![GitHub Issues](https://camo.githubusercontent.com/d2743e18cdfe5d4089b346a68ceb31882ed157d57e60c6e248a0a5a8636268cc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f416c6578536b7279706e796b2f737472326e616d652e737667)](https://github.com/AlexSkrypnyk/str2name/issues)[![GitHub Pull Requests](https://camo.githubusercontent.com/f9bdc655935cb3cd5b179137459dbf1175cc772990fb207793e913a3635527a6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d70722f416c6578536b7279706e796b2f737472326e616d652e737667)](https://github.com/AlexSkrypnyk/str2name/pulls)[![Test PHP](https://github.com/AlexSkrypnyk/str2name/actions/workflows/test-php.yml/badge.svg)](https://github.com/AlexSkrypnyk/str2name/actions/workflows/test-php.yml)[![codecov](https://camo.githubusercontent.com/fd108d25e93e52bd239ab86932ed1e5a473a1fd4d645c05b72231e5a520ba70f/68747470733a2f2f636f6465636f762e696f2f67682f416c6578536b7279706e796b2f737472326e616d652f67726170682f62616467652e7376673f746f6b656e3d37574542314958425954)](https://codecov.io/gh/AlexSkrypnyk/str2name)[![GitHub release (latest by date)](https://camo.githubusercontent.com/fae086c6a067a9755e025b47335c89d71ca0c250a41491acc767c30bfdbe9f06/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f416c6578536b7279706e796b2f737472326e616d65)](https://camo.githubusercontent.com/fae086c6a067a9755e025b47335c89d71ca0c250a41491acc767c30bfdbe9f06/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f416c6578536b7279706e796b2f737472326e616d65)[![LICENSE](https://camo.githubusercontent.com/d65348dfffa1a940742c8f8cd11752f720d558226fd0b0c65ca5e60b00b07b77/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f416c6578536b7279706e796b2f737472326e616d65)](https://camo.githubusercontent.com/d65348dfffa1a940742c8f8cd11752f720d558226fd0b0c65ca5e60b00b07b77/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f416c6578536b7279706e796b2f737472326e616d65)[![Renovate](https://camo.githubusercontent.com/35389190ce58a3690fe850342c1c3fd4f54e4c10ba8996741c8558ee24bf50dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72656e6f766174652d656e61626c65642d677265656e3f6c6f676f3d72656e6f76617465626f74)](https://camo.githubusercontent.com/35389190ce58a3690fe850342c1c3fd4f54e4c10ba8996741c8558ee24bf50dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72656e6f766174652d656e61626c65642d677265656e3f6c6f676f3d72656e6f76617465626f74)

---

Installation and usage
----------------------

[](#installation-and-usage)

`Str2Name` is a self-contained class that can be included in any PHP project directly or via Composer. It does not have any dependencies.

There are two ways to include `Str2Name` in your project:

- [Direct download](#direct-download)
- [Composer](#composer)

### Direct download

[](#direct-download)

1. Download the file from the [releases page](https://github.com/AlexSkrypnyk/str2name/releases)
2. Register the namespace in `composer.json` of your project:

```
{
    "autoload": {
        "psr-4": {
            "AlexSkrypnyk\\Str2Name\\": "path/to/src/Str2Name.php"
        }
    }
}
```

3. Use it in your project:

```
