PHPackages                             nhpiash/php-input-filter - 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. nhpiash/php-input-filter

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

nhpiash/php-input-filter
========================

A lightweight and reusable PHP package to sanitize and validate user inputs like strings, integers, emails, URLs, booleans, and arrays.

v1.0.0(1y ago)13MITPHPPHP &gt;=7.4

Since May 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/devnhpiash/php-input-filter)[ Packagist](https://packagist.org/packages/nhpiash/php-input-filter)[ RSS](/packages/nhpiash-php-input-filter/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

PHP Input Filter
================

[](#php-input-filter)

A lightweight, reusable PHP packagez for sanitizing and validating user inputs. Designed to prevent XSS, malformed inputs, and improve form data consistency.

---

📌 Features
----------

[](#-features)

- Sanitize and validate:
    - Strings
    - Integers
    - Emails
    - URLs
    - Booleans
    - Arrays
- Centralized input handling
- PSR-4 autoloading (Composer ready)
- No framework dependency

---

🚀 Installation
--------------

[](#-installation)

You can use Composer to install this package:

```
composer require nhpiash/php-input-filter
```

Or include manually:
--------------------

[](#or-include-manually)

```
require 'src/InputFilter.php'
```

### ✨ Usage

[](#-usage)

```
use Nhpiash\InputFilter\InputFilter;

$name     = InputFilter::getString($_POST['name']);
$age      = InputFilter::getInt($_POST['age']);
$email    = InputFilter::getEmail($_POST['email']);
$website  = InputFilter::getSanitizedURL($_POST['website']);
$agreed   = InputFilter::getBoolean($_POST['terms']);
$filtered = InputFilter::getFilteredArray($_POST, 'string');
```

### 📂 Project Structure

[](#-project-structure)

```
php-input-filter/
├── vendor/                  ← Composer autoloading
│   └── autoload.php
├── src/
│   └── InputFilter.php      ← Core Library
├── examples/
│   ├── form.php             ← Bootstrap Example Form
│   └── validate-form.php    ← Input Handling Example
├── README.md
├── documentation.txt
├── composer.json
└── composer.lock
```

🙌 Contributing
--------------

[](#-contributing)

Contributions, issues, and feature requests are welcome!
Feel free to check the [issues page](https://github.com/devnhpiash/php-input-filter/issues) if you'd like to collaborate.

---

📄 License
---------

[](#-license)

This project is open source and available under the [MIT License](LICENSE).

---

📬 Contact
---------

[](#-contact)

If you like this project or have any questions, feel free to reach out!

- GitHub: [@devnhpiash](https://github.com/devnhpiash)
- Email:

---

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance46

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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

Unknown

Total

1

Last Release

413d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/82053193?v=4)[Nazmul Hasan Piash](/maintainers/nhpiash)[@nhpiash](https://github.com/nhpiash)

---

Top Contributors

[![devnhpiash](https://avatars.githubusercontent.com/u/207661065?v=4)](https://github.com/devnhpiash "devnhpiash (2 commits)")[![nhpiash](https://avatars.githubusercontent.com/u/82053193?v=4)](https://github.com/nhpiash "nhpiash (2 commits)")

### Embed Badge

![Health badge](/badges/nhpiash-php-input-filter/health.svg)

```
[![Health](https://phpackages.com/badges/nhpiash-php-input-filter/health.svg)](https://phpackages.com/packages/nhpiash-php-input-filter)
```

###  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)
