PHPackages                             maniruzzaman/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. maniruzzaman/sanitizer

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

maniruzzaman/sanitizer
======================

A php package that would sanitize your every input and HTML

0.0.7(4y ago)1012.4k↓27.8%2MITPHPPHP &gt;=7.1

Since Nov 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ManiruzzamanAkash/sanitizer)[ Packagist](https://packagist.org/packages/maniruzzaman/sanitizer)[ Patreon](https://www.patreon.com/maniruzzaman)[ RSS](/packages/maniruzzaman-sanitizer/feed)WikiDiscussions main Synced 2d ago

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

PHP Sanitizer
=============

[](#php-sanitizer)

Sanitize and escape every values in your PHP Application.

---

This solution will make PHP developer life easy, very easy and developers would be able to create a secure application quickly and effortlessly.

Let's see inside of this.

Requirement
-----------

[](#requirement)

- **PHP:** 7.1 or later
- **PHP Unit (in dev):** 7

Latest Version
--------------

[](#latest-version)

`0.0.7`

How to install
--------------

[](#how-to-install)

```
composer require maniruzzaman/sanitizer
```

Documentation
-------------

[](#documentation)

Instantiation and loading.

```
// at top of the class autoload
use Maniruzzaman\Sanitizer\Sanitize;

// instantiate anywhere if needed
$sanitize = new Sanitize();
```

#### Sanitize Text

[](#sanitize-text)

**Example 1: Sanitize text with script:**

```
$string  = 'Text with script alert("you are hacked...")';
Sanitize::text($string);
#Output: Text with issuealert(&quot;you are hacked...&quot;)
```

**Example 2: Sanitize text with html texts:**

```
$string  = 'Text with script This is strong text';
Sanitize::text($string);
#Output: Text with script This is strong text
```

#### Sanitize Attribute

[](#sanitize-attribute)

**Example 3: Sanitize attribute to filter out unnecessary strings:**

```
$string  = 'https://devsenv.comwelcome';

$sanitize = new Sanitize();
$sanitize->attr($string);
#Output: https:://devsenv.com
```

#### More is coming...

[](#more-is-coming)

Testing
-------

[](#testing)

We've used [PHPUnit](https://phpunit.readthedocs.io/en/9.5/index.html)to test our codes.

Check if everything passes test cases or not. You can check our test cases to see the implementations of Sanitizer.

```
// For full directory
phpunit tests

// For specific file test
phpunit tests/SanitizeTest.php
```

Release Notes:
--------------

[](#release-notes)

#### Release version `0.0.7`

[](#release-version-007)

- \[Enhancement\] Added unit test for text() helper sanitize function.
- \[Enhancement\] Added some security and fund links

#### Release version `0.0.6`

[](#release-version-006)

- \[Enhancement\] Updated some doc-block
- \[Enhancement\] Structured some code base
- \[Enhancement\] Updated Minimum PHP Version requirement
- \[Enhancement\] Added PHP Unit test support dev package

#### Release version `0.0.5`

[](#release-version-005)

- Fixed some autoloading issue with documenting

#### Release version `0.0.4`

[](#release-version-004)

- Fixed autoloading functions

#### Release version `0.0.3`

[](#release-version-003)

- Removed some unused autoload dependency

#### Release version `0.0.2`

[](#release-version-002)

- Added `Url` Sanitization

#### Release version `0.0.1`

[](#release-version-001)

- Release some simple escaping functions.
- Added `text` sanitization
- Added `attribute` sanitization

License
-------

[](#license)

The Library is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

Support
-------

[](#support)

Do you wanna support me to buy a coffee? Please be one of my patreon -

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.5% 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 ~0 days

Total

7

Last Release

1701d ago

PHP version history (2 changes)0.0.1PHP &gt;=5.3.0

0.0.6PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/9dfb6c3fa99e93ff61233676564ec34dd29a863dc9f0495a882879fe0b5b173e?d=identicon)[ManiruzzamanAkash](/maintainers/ManiruzzamanAkash)

---

Top Contributors

[![ManiruzzamanAkash](https://avatars.githubusercontent.com/u/17502625?v=4)](https://github.com/ManiruzzamanAkash "ManiruzzamanAkash (29 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")

---

Tags

escapingphpphp-sanitizersanitize-htmlsanitizer

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[marcosh/php-validation-dsl

A DSL for validating data in a functional fashion

483.9k](/packages/marcosh-php-validation-dsl)

PHPackages © 2026

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