PHPackages                             sugiphp/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. sugiphp/filter

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

sugiphp/filter
==============

Filter helper functions

1.0.0(11y ago)539011MITPHPPHP &gt;=5.3

Since Dec 16Pushed 11y ago1 watchersCompare

[ Source](https://github.com/SugiPHP/Filter)[ Packagist](https://packagist.org/packages/sugiphp/filter)[ RSS](/packages/sugiphp-filter/feed)WikiDiscussions master Synced 2mo ago

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

Filter
======

[](#filter)

[![Build Status](https://camo.githubusercontent.com/9b71c00f1b09a73210eb2de7861b3f90b822ef83730ab83110333825c096a2a7/68747470733a2f2f7472617669732d63692e6f72672f537567695048502f46696c7465722e706e67)](https://travis-ci.org/SugiPHP/Filter)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b8ad52bf2f4fc4a326560945d5f40531258914bb12ed47180b8a2ad5c41c6042/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f537567695048502f46696c7465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/SugiPHP/Filter/?branch=master)

Simple filter helper functions.

Integers
--------

[](#integers)

Validates integer value in a range within $min and $max if they are not false. Returns default value if the given is not an integer or it's out of the range.

```

```

Usually a developer needs to validate something that was provided by a user, so above example are rarely used. Instead several other filters for integers are more often used:

```

```

Strings
-------

[](#strings)

Validates string values. You can set size restrictions - minimum and maximum string lengths. Returns default value if the given string is outside the boundaries or not a string.

```

```

Similar to integer filters there are some for validating string from $\_GET, $\_POST and $\_COOKIE arrays

```

```

URL's
-----

[](#urls)

Validates URL, accepting only http or https protocols

```

```

Arrays
------

[](#arrays)

```

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

4168d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/991c2430ace2ac70cb06507ae39e9e556e43bff5380e45ddd72c0f0294347794?d=identicon)[tzappa](/maintainers/tzappa)

---

Top Contributors

[![tzappa](https://avatars.githubusercontent.com/u/140298?v=4)](https://github.com/tzappa "tzappa (13 commits)")

---

Tags

filter

### Embed Badge

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

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

###  Alternatives

[clue/stream-filter

A simple and modern approach to stream filtering in PHP

1.7k261.7M7](/packages/clue-stream-filter)[laminas/laminas-filter

Programmatically filter and normalize data and files

9428.0M150](/packages/laminas-laminas-filter)[friendsofcake/search

CakePHP Search plugin using PRG pattern

1742.0M37](/packages/friendsofcake-search)[htmlawed/htmlawed

Official htmLawed PHP library for HTML filtering

401.1M9](/packages/htmlawed-htmlawed)[outl1ne/nova-multiselect-filter

Multiselect filter for Laravel Nova.

45802.7k3](/packages/outl1ne-nova-multiselect-filter)[outl1ne/nova-detached-filters

This Laravel Nova package allows you to detach filters from the filter dropdown

64343.5k](/packages/outl1ne-nova-detached-filters)

PHPackages © 2026

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