PHPackages                             hichemtab-tech/namecrement - 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. hichemtab-tech/namecrement

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

hichemtab-tech/namecrement
==========================

A smart php utility that generates unique incremental names, preventing naming collisions by automatically appending incremental suffixes.

1.2.1(10mo ago)56MITPHPPHP ^8.2 || ^8.3 || ^8.4CI passing

Since Apr 28Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/HichemTab-tech/Namecrement-php)[ Packagist](https://packagist.org/packages/hichemtab-tech/namecrement)[ Fund](https://www.buymeacoffee.com/hichemtabtech)[ GitHub Sponsors](https://github.com/hichemtab-tech)[ RSS](/packages/hichemtab-tech-namecrement/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (1)Versions (6)Used By (0)

Namecrement (PHP)
=================

[](#namecrement-php)

[![Tests](https://github.com/HichemTab-tech/Namecrement-php/workflows/Tests/badge.svg)](https://github.com/HichemTab-tech/Namecrement-php/workflows/Tests/badge.svg)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](https://github.com/HichemTab-tech/Namecrement-php/blob/master/LICENSE)[![Packagist Version](https://camo.githubusercontent.com/72f333b9ef808e424bfe5f4261df965d382ee469b2be0561c3db3b22e5eb32fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68696368656d7461622d746563682f6e616d656372656d656e74)](https://camo.githubusercontent.com/72f333b9ef808e424bfe5f4261df965d382ee469b2be0561c3db3b22e5eb32fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68696368656d7461622d746563682f6e616d656372656d656e74)

**Smart unique name generator for PHP**
Automatically generates a unique name by incrementing it if needed — just like `"file" → "file (1)" → "file (2)"` and so on.

---

✨ Features
----------

[](#-features)

- Generate unique names based on existing ones
- Smart gap detection (fills missing indexes first)
- Lightweight, dependency-free
- Perfect for filenames, labels, IDs, and more

---

### 📦 Also Available

[](#-also-available)

- JavaScript: [Namecrement](https://github.com/HichemTab-tech/Namecrement)
- Python: [Namecrement-py](https://github.com/HichemTab-tech/Namecrement-py)

📦 Installation
--------------

[](#-installation)

```
composer require hichemtab-tech/namecrement-php
```

---

🚀 Usage
-------

[](#-usage)

```
