PHPackages                             dakujem/shorts - 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. dakujem/shorts

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

dakujem/shorts
==============

A flexible tool to shorten or limit person names in length or create initials.

0.1.1(6y ago)171.7k↑16.4%UnlicensePHPPHP &gt;=7.1

Since Oct 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/dakujem/shorts)[ Packagist](https://packagist.org/packages/dakujem/shorts)[ RSS](/packages/dakujem-shorts/feed)WikiDiscussions master Synced 1mo ago

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

🩳 shorts
========

[](#-shorts)

[![PHP from Packagist](https://camo.githubusercontent.com/8c7b093998b6acd7e8d64b3f66257d5259aa8e91d0d3bac4bb9410b324e26c99/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f64616b756a656d2f73686f727473)](https://camo.githubusercontent.com/8c7b093998b6acd7e8d64b3f66257d5259aa8e91d0d3bac4bb9410b324e26c99/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f64616b756a656d2f73686f727473)[![Build Status](https://camo.githubusercontent.com/eece0193d1a7d70e158f723d3cc24fd7a9a952fba5c23f251482c831878bf569/68747470733a2f2f7472617669732d63692e6f72672f64616b756a656d2f73686f7274732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dakujem/shorts)[![Nature Friendly](https://camo.githubusercontent.com/c151a8027e9eaf7550fe079a9661ae486da4042b6a1f85d45184a542493651b6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6e61747572652532302546302539462538432542332d667269656e646c792532302546302539462539322539412d677265656e)](https://camo.githubusercontent.com/c151a8027e9eaf7550fe079a9661ae486da4042b6a1f85d45184a542493651b6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6e61747572652532302546302539462538432542332d667269656e646c792532302546302539462539322539412d677265656e)

Use this tool to shorten or limit personal names to desired length, or to use initials instead of a full name.
Supports *Unicode* / UTF-8 names.

- limit / cap name length (with the aim to keep the name as legible as possible): ```
    | John Roland Reuel Tolkien |
    | --> John R. Reuel Tolkien |   # last name priority
    | -----> John R. R. Tolkien |
    | -------> J. R. R. Tolkien |
    | ---------> J.R.R. Tolkien |
    | -----------> John Tolkien |
    | ---------------> J.R.R.T. |
    | -------------------> JRRT |
    | ---------------------> JT |
    |                           |
    | John Roland Reuel Tolkien |
    | John R. R. Tolkien
