PHPackages                             erlandmuchasaj/sanitize - 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. erlandmuchasaj/sanitize

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

erlandmuchasaj/sanitize
=======================

A package to sanitize your input.

1.0.6(3mo ago)146.0k↓33.3%MITPHPPHP ^7.3|^7.4|^8.0|^8.1|^8.2

Since Feb 22Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/erlandmuchasaj/sanitize)[ Packagist](https://packagist.org/packages/erlandmuchasaj/sanitize)[ Docs](https://github.com/erlandmuchasaj/sanitize)[ Fund](https://ko-fi.com/erlandmuchasaj)[ Fund](https://paypal.me/emcms?country.x=AL&locale.x=en_US)[ RSS](/packages/erlandmuchasaj-sanitize/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (8)Used By (0)

PHP sanitize
============

[](#php-sanitize)

This is a PHP package that helps to sanitize your input when performing search queries to DB. It cleans the input from all malicious characters.

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

[](#installation)

You can install the package via composer:

```
composer require erlandmuchasaj/sanitize
```

Usage
-----

[](#usage)

Sanitize library offers a sanitize method that takes a parameter a dirty string parameter and return a cleaned string.

```
use ErlandMuchasaj\Sanitize\Sanitize;

$dirtyString = 'Hello - World';

$sanitizedString = Sanitize::sanitize($dirtyString);

// do something with the sanitized text
// you can: $words = explode(' ', $sanitizedString);
// and search the DB per each word.
```

---

Support me
----------

[](#support-me)

I invest a lot of time and resources into creating [best in class open source packages](https://github.com/erlandmuchasaj?tab=repositories).

If you found this package helpful you can show support by clicking on the following button below and donating some amount to help me work on these projects frequently.

[ ![buy me a coffee](https://camo.githubusercontent.com/58c5ff7fa04b3393e6eb6103b591ef6dceee6e1c64dc924ba2713a86b51d8cb7/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f67756964656c696e65732f646f776e6c6f61642d6173736574732d322e737667)](https://www.buymeacoffee.com/erland)Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please see [SECURITY](SECURITY.md) for details.

Credits
-------

[](#credits)

- [Erland Muchasaj](https://github.com/erlandmuchasaj)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance79

Regular maintenance activity

Popularity30

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Recently: every ~263 days

Total

7

Last Release

108d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d7469281a88a626e0fa6ba92fad648de2d1151e931b0ef844446539aa73660a?d=identicon)[erlandmuchasaj](/maintainers/erlandmuchasaj)

---

Top Contributors

[![erlandmuchasaj](https://avatars.githubusercontent.com/u/6152399?v=4)](https://github.com/erlandmuchasaj "erlandmuchasaj (18 commits)")

---

Tags

cleanupinput-validationphpprepare-inputsanitizepackagelibrarycleaninputEscapesanitize

### Embed Badge

![Health badge](/badges/erlandmuchasaj-sanitize/health.svg)

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

###  Alternatives

[htmlawed/htmlawed

Official htmLawed PHP library for HTML filtering

401.1M9](/packages/htmlawed-htmlawed)[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)

PHPackages © 2026

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