PHPackages                             blazorazem/sanitizer - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. blazorazem/sanitizer

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

blazorazem/sanitizer
====================

Sanitizer is a package convenient for sanitizing proper names, email addresses, URLs etc.

1.2.1(11y ago)0391↓100%1MITPHPPHP &gt;=5.3.0

Since May 7Pushed 11y ago1 watchersCompare

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

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

Sanitizer
=========

[](#sanitizer)

Sanitizer is a package convenient for sanitizing proper names (names of persons, places, or certain special things), email addresses, URLs etc.

General features
----------------

[](#general-features)

- Converts proper names (names of persons, places, or certain special things) to sanitized CamelCase format
- Converts email addresses to sanitized lower-cased email format
- Converts a string of characters to sanitized URL format

Features on URL sanitizing
--------------------------

[](#features-on-url-sanitizing)

- Converts internal character encoding to UTF-8
- Replaces currency symbols
- Replaces accented characters with corresponding unaccented characters
- Replaces Cyrillic script characters with corresponding Latin script characters
- Replace other reserved, unsafe and special characters
- Converts to lower-case, trims and returns sanitized URL string

Installation via Composer
-------------------------

[](#installation-via-composer)

Sanitizer is installable and auto-loadable via Composer as [blazorazem/sanitizer](https://packagist.org/packages/blazorazem/sanitizer/).

First include the Sanitizer package.

```
"blazorazem/sanitizer": "dev-master"
```

Now simply use the Sanitizer class.

```
use BlazOrazem\Sanitizer;
```

Stand-alone usage
-----------------

[](#stand-alone-usage)

Download a release or clone this repository, then require or include its *src/Sanitizer.php* file.

Basic Usage
-----------

[](#basic-usage)

CamelCase proper names (names of persons, places, or certain special things).

```
Sanitizer::name('mr. chuck norris');
// Returns: Mr. Chuck Norris
```

Validate and sanitize email address format.

```
Sanitizer::email('CHUCK@norris.COM');
// Returns: chuck@norris.com

Sanitizer::email('CHUCK @norris?.COM');
// Returns: null

Sanitizer::email('CHUCK @norris?.COM');
// Returns: null
```

Sanitize URL

```
Sanitizer::url('this Shőüld be \n sąn`itiz˘ed /// web-safe STRING/ with € cú˘rrenc~y at THE...END');
// Returns: this-should-be-sanitized-web-safe-string/-with-eur-currency-at-the.end
```

Convert accented characters

```
Sanitizer::url('Ŵĥăţ ĩş ŷōuř ñąmĕ? Mý ŉǎmę ĭŝ Ĉħǚçķ Ñöŕŗǐś.');
// Returns: what-is-your-name-my-name-is-chuck-norris
```

Convert Cyrillic script URL to Latin script

```
Sanitizer::url('Как вас зовут? Меня зовут Чхучк Норрис.');
// Returns: kak-vas-zovut-mena-zovut-chuck-norris
```

Requirements
------------

[](#requirements)

The Sanitizer package requires PHP 5.3 or later, and has no dependencies.

Support
-------

[](#support)

- [Homepage](http://www.numencode.com/)
-

Authors
-------

[](#authors)

- Chief developer: Blaz Orazem
- Maintainer: Blaz Orazem

License
-------

[](#license)

Sanitizer is issued under MIT license.

```
Copyright (C) 2015 Blaz Orazem

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

4018d ago

PHP version history (2 changes)1.0PHP &gt;=5.0.0

1.2PHP &gt;=5.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/975dd5a96021f39a82e0708c39da6be28b68a78bb80566fb1cbc91dc64edf8d0?d=identicon)[blazorazem](/maintainers/blazorazem)

---

Tags

urlconvertsanitizecyrillicweb-safe

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/blazorazem-sanitizer/health.svg)

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

###  Alternatives

[abcaeffchen/sepa-utilities

SepaUtilities provides useful methods for validating and sanitizing inputs used in SEPA files supporting PHP &gt;= 8.1.

312.0M2](/packages/abcaeffchen-sepa-utilities)[surgiie/transformer

A data transforming/formatting package for php.

12724.3k1](/packages/surgiie-transformer)[romeoz/rock-sanitize

Flexible sanitizator for PHP.

4720.1k9](/packages/romeoz-rock-sanitize)[mathiasreker/php-svg-optimizer

php-svg-optimizer is a PHP library designed to optimize SVG files by applying various transformations and cleanup operations.

338.9k2](/packages/mathiasreker-php-svg-optimizer)[ondrej-vrto/php-filename-sanitize

Removes all forbidden characters from the file name or path.

1120.6k1](/packages/ondrej-vrto-php-filename-sanitize)[erlandmuchasaj/sanitize

A package to sanitize your input.

146.0k](/packages/erlandmuchasaj-sanitize)

PHPackages © 2026

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