grd/ban-words

This package is abandoned and no longer maintained. The author suggests using the abandon package instead.

A simple PHP ban bad words

Maintainers

Details

github.com/Gwigzz/banWords

Installs: 20

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

pkg:composer/grd/ban-words

dev-main 2026-01-26 12:45 UTC

This package is auto-updated.

Last update: 2026-01-26 12:46:39 UTC


README

Simple and fast PHP ban bad words you want.

You need to set the bad words in vendor/src/BadWords.php in array of list method.

Inportant note

banWords does not and never will prevent XSS or SQL Injection.

Require

  • PHP >= 7.4
  • composer

Simple usage

composer require grd/ban-words
use App\Grd\BanWords\BanWords;

require_once './vendor/autoload.php';

// 1. Initialize 
$banWords = new BanWords('hello noob you are bad !');

// very simple
var_dump($banWords->check());

// get true if bad words spotted
$banWords->check()->getSignal();        # return true / false

// get normal characters
$banWords->check()->getCharacters();    # return "hello noob you are bad !"

// get ban words
$banWords->check()->getFilter();        # return "hello *** you are *** !"
This script is very simple.
You are welcome to improve it !