PHP Classes


Recommend this page to a friend!
  Classes of Pierre-Henry Soria   PHP Not Allowed   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Not Allowed
Detect and filter unwanted information
Author: By
Last change: [README] Fixed syntax error in example section
[README] Update library summary
Update comments in txt files
[README] Fixed typos/caps
Date: 4 years ago
Size: 1,950 bytes


Class file image Download

? Not Allowed ?

NotAllowed is a simple lightweight PHP 7.2 library that helps you to censor words, profane words, blacklisted IPs, forbidden user names, banned bank card numbers, etc.

You can add easily new specific keywords (such as IPs, usernames, bank accounts, words, etc) to ban in ~/src/banned-data/* folder.

? Server Requirement

PHP 7.2 or higher.

? Installation (with Composer)

composer require ph-7/notallowed

? Usage

Simple example of what you can do with it :)

use PH7\NotAllowed\Ban;

if (Ban::isUsername('admin')) {
    echo '"admin" is not allowed as username.';

if (Ban::isEmail('')) {
    echo '"" domain is considered as a email spam host.';

if (Ban::isWord('He is an asshole')) {
    echo 'Please watch your mouth :-)';

if(Ban::isIp('')) {
    echo 'This IP address is blacklisted';

? Author

Pierre-Henry Soria")


[Pierre-Henry Soria][author-url], a highly passionate, zen & cool software engineer ?

? Used By...

[pH7Builder][ph7cms-url], a social dating webapp builder. Used here:

? License

Generously distributed under [MIT License][license-url]!

<!-- GitHub's Markdown reference links --> [author-url]: [ph7cms-url]: [license-url]: [twitter-image]: [twitter-url]: