PHPackages                             enricodias/nameize - 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. enricodias/nameize

ActiveLibrary

enricodias/nameize
==================

A simple class to correctly capitalize full names.

v0.4.2(6y ago)3286MITPHPPHP &gt;=5.6

Since Jun 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/enricodias/Nameize)[ Packagist](https://packagist.org/packages/enricodias/nameize)[ RSS](/packages/enricodias-nameize/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

Nameize
=======

[](#nameize)

[![Build Status](https://camo.githubusercontent.com/081fd94170d1bcc83b84236836569e2988e5466e517949c11dd5c712eb268e53/68747470733a2f2f7472617669732d63692e636f6d2f656e7269636f646961732f6e616d65697a652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/enricodias/nameize)[![Codacy Badge](https://camo.githubusercontent.com/360751fa23167f8480fffc287e3b7653a19571bad2d460edd49fde5cf0854840/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f6365396366613237333935333430323161313561656266623730333765663164)](https://www.codacy.com/manual/enricodias/nameize?utm_source=github.com&utm_medium=referral&utm_content=enricodias/nameize&utm_campaign=Badge_Coverage)[![Codacy Badge](https://camo.githubusercontent.com/67589dd00cf4bb3eed686cef9fef9495aeb9aaf6b6cf9ba7e928cf64c291ab53/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6365396366613237333935333430323161313561656266623730333765663164)](https://www.codacy.com/manual/enricodias/nameize?utm_source=github.com&utm_medium=referral&utm_content=enricodias/nameize&utm_campaign=Badge_Grade)[![Latest version](https://camo.githubusercontent.com/e471a2be9b0f29022ef20f15a1b2f93254aae50b71a982a58b1bc8eda65c80f4/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e7269636f646961732f6e616d65697a652e737667)](https://packagist.org/packages/enricodias/nameize)[![Downloads total](https://camo.githubusercontent.com/b6c0819bbf0be2289fb9583d56e0f2152be4ca2e87ac366a41cea8164a1b4f09/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656e7269636f646961732f6e616d65697a652e737667)](https://packagist.org/packages/enricodias/nameize)[![License](https://camo.githubusercontent.com/c38821f1ed205bb46d984eba6d111db9520032f397d57e3e95354d9a4f7b0d53/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656e7269636f646961732f6e616d65697a652e737667)](https://github.com/enricodias/nameize/blob/master/LICENSE.md)

A simple class to correctly capitalize full names.

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

[](#installation)

Require this package with Composer in the root directory of your project

```
composer require enricodias/nameize
```

and include the composer's autoloader in your code

```
include 'vendor/autoload.php';
```

Usage
-----

[](#usage)

### Simple usage

[](#simple-usage)

```
echo \enricodias\Nameize::create()->name("Carlo D'ippoliti"); // Carlo D'Ippoliti
```

or

```
$nameize = new \enricodias\Nameize();

echo $nameize->name("Matteo Dell'aqcua");  // Matteo Dell'Aqcua
echo $nameize->name("john o'grady-smith"); // John O'Grady-Smith
```

### Specifying special characters

[](#specifying-special-characters)

The method `setAllowedCharacters()` receives an array of special characters. Those characters signalizes that the next letter should be in upper case. If no character is specified, the default `array("'", '-')` is used. If you pass a string, it will be consider a single character.

```
$nameize = new \enricodias\Nameize();

$nameize->setAllowedCharacters("'");

echo $nameize->name("Matteo Dell'aqcua");  // Matteo Dell'Aqcua
echo $nameize->name("john o'grady-smith"); // John O'Grady-smith
```

or with method chaining:

```
echo \enricodias\Nameize::create()
    ->setAllowedCharacters("-")
    ->name("john o'grady-smith"); // John O'grady-Smith
```

### Minimum length

[](#minimum-length)

Some languages require capitalization on the first letter of every word regardless of their size. The `setMinLength()` method sets the minimum length of which words will be capitalized (min: 1, max: 5, default: 4).

```
$nameize = new \enricodias\Nameize();

$nameize->setMinLength(1);

echo $nameize->name("Tri vu phu");    // Tri Vu Phu
echo $nameize->name("Shuanping dai"); // Shuanping Dai
```

or with method chaining:

```
echo \enricodias\Nameize::create()
    ->setMinLength(1)
    ->name("Tri vu phu"); // Tri Vu Phu
```

Your application may detect the user's country and use the appropriate minLength value.

Additional features
-------------------

[](#additional-features)

If you need more features I recommend using a name parser such as

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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

Total

7

Last Release

2358d ago

PHP version history (2 changes)v0.1PHP &gt;=5.3.3

v0.3PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d69ec6f15869c0c5c5f1faabf873e4b05b1082dce513f5342904faea25f2500?d=identicon)[enricodias](/maintainers/enricodias)

---

Top Contributors

[![enricodias](https://avatars.githubusercontent.com/u/32619307?v=4)](https://github.com/enricodias "enricodias (85 commits)")

---

Tags

formatnameformatercapitalize

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/enricodias-nameize/health.svg)

```
[![Health](https://phpackages.com/badges/enricodias-nameize/health.svg)](https://phpackages.com/packages/enricodias-nameize)
```

###  Alternatives

[moment/moment

Parse, validate, manipulate, and display dates in JavaScript.

48.1k2.1M37](/packages/moment-moment)[laravel/pint

An opinionated code formatter for PHP.

3.1k147.7M13.2k](/packages/laravel-pint)[willdurand/negotiation

Content Negotiation tools for PHP provided as a standalone library.

1.4k122.0M157](/packages/willdurand-negotiation)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[fightbulc/moment

Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js

9693.2M10](/packages/fightbulc-moment)[netcarver/textile

Textile markup language parser

2311.5M16](/packages/netcarver-textile)

PHPackages © 2026

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