PHPackages                             actinity/sanitiser - 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. actinity/sanitiser

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

actinity/sanitiser
==================

A simple email sanitiser to clean up common input errors

1.2.1(1y ago)02.8k—0%MITPHPPHP ^7.0|^8.0

Since Aug 5Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/Actinity/sanitiser)[ Packagist](https://packagist.org/packages/actinity/sanitiser)[ RSS](/packages/actinity-sanitiser/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (11)Used By (0)

A simple class to fix common input errors in Email addresses.

This library takes a string and tries to turn it into a 'clean' email address without any extraneous junk that would cause it to fail.

### Why would I use it?

[](#why-would-i-use-it)

This library was written to simplify importing email addresses from files and other systems where proper sanitisation hadn't previously been applied. Lists of users to add to a system supplied in Excel, email addresses collected from conferences etc. The intention is to be 'good enough' to fix 99% of the common errors you see in that kind of data, leaving you free to only look at the ones that definitely failed.

### What does it do?

[](#what-does-it-do)

Catch and 'fix' a variety of common issues like:

- Trailing semi-colons, commas etc
- Leading or trailing whitespace (including zero-widths)
- Addresses wrapped in quotes or primes
- Addresses wrapped in angle brackets (discarding anything else like a name)
- Rejects obviously broken addresses like `test`, `test@`, `test@.` etc.

### What it doesn't do

[](#what-it-doesnt-do)

- Verify that the email address/domain/mail server exists or will work, obviously. The only way to test an email address is to actually send to it. Anyone who tells you otherwise is selling something.
- Work for every possible RFC compliant email - there are plenty of things you're technically allowed to do that you're not going to come across in the real world. e.g. `me@localhost`
- Guarantee that it matches the user's intent (e.g. if there were multiple email addresses listed, it will only pick the first one. Is that correct? ¯\\*(ツ)*/¯)

### How to use it.

[](#how-to-use-it)

`use Actinity\Sanitiser\Sanitiser;`

`$address = Sanitiser::clean($address)`

`clean()` returns either a clean address, or false if it looks hopelessly broken.

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance59

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity74

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

Recently: every ~225 days

Total

9

Last Release

605d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.0

1.1PHP ^7.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c309728d0e50bc4dfbc0dc31065ec1a2f244cce90ded1b742c9a67d07a2bebed?d=identicon)[actinity](/maintainers/actinity)

---

Top Contributors

[![Actinity](https://avatars.githubusercontent.com/u/1878605?v=4)](https://github.com/Actinity "Actinity (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/actinity-sanitiser/health.svg)

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

PHPackages © 2026

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