PHPackages                             clsystems/php-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. [Search &amp; Filtering](/categories/search)
4. /
5. clsystems/php-filter

ActivePhp[Search &amp; Filtering](/categories/search)

clsystems/php-filter
====================

Php Input Filter package

v1.0.0(5y ago)0641MITPHPPHP &gt;=5.4.0

Since Jun 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/CLSystems/php-filter)[ Packagist](https://packagist.org/packages/clsystems/php-filter)[ Docs](https://github.com/clsystems/php-filter)[ RSS](/packages/clsystems-php-filter/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (2)Used By (1)

Php input filter
================

[](#php-input-filter)

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

[](#installation-via-composer)

```
{
	"require": {
		"clsystems/php-filter": "~1.0"
	}
}
```

Alternatively, from the command line:

```
composer require clsystems/php-filter
```

Usage
-----

[](#usage)

```
use CLSystems\Php\Filter;

// Syntax
Filter::clean($source, $type);

// Example
$source = 'Hello World!';

// Return 'Hello World!'
$filtered = Filter::clean($source, 'string');

// Source array
$source = [
	'Hello World!',
	'Hello VietNam!',
];

// Return ['Hello World!', 'Hello VietNam!']
$filtered = Filter::clean($source, 'string');

// Multi-type
$source = '  Hello World!  ';

// Return 'Hello World!'
$filtered = Filter::clean($source, ['string', 'trim']);
```

Filter types
------------

[](#filter-types)

- int
- uint (unsigned int)
- float
- ufloat (unsigned float)
- boolean
- alphaNum (alpha numeric string)
- base64
- string (no HTML tags)
- email
- url
- slug (url alias without slash)
- path (url alias with slash)
- unset (return NULL value)
- jsonEncode
- jsonDecode
- yesNo (return 'Y' or 'N')
- inputName (regex /\[^a-zA-Z0-9\_\]/)
- unique (array unique)
- basicHtml

Fallback default
----------------

[](#fallback-default)

```
if (function_exists($type))
{
	if (is_array($value))
	{
		$result = array_map($type, $value);
	}
	else
	{
		$result = $type($value);
	}
}
else
{
	$result = $value;
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

2164d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2074187?v=4)[CLSystems](/maintainers/CLSystems)[@CLSystems](https://github.com/CLSystems)

---

Tags

phpfilterinput

### Embed Badge

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

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

###  Alternatives

[htmlawed/htmlawed

Official htmLawed PHP library for HTML filtering

401.1M9](/packages/htmlawed-htmlawed)[digital-creative/nova-range-input-filter

A Laravel Nova range input filter.

18209.3k1](/packages/digital-creative-nova-range-input-filter)

PHPackages © 2026

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