2017 © Pedro Peláez
 

library badwords

Badwords filter in PHP

image

buchin/badwords

Badwords filter in PHP

  • Tuesday, March 6, 2018
  • by buchin
  • Repository
  • 1 Watchers
  • 3 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 17 % Grown

The README.md

buchin/badwords

PHP bad words detector, (*1)

Installation

composer require buchin/badwords dev-master

Usage

<?php
use Buchin\Badwords\Badwords;

Badwords::isDirty('Blood sugar sex magic');

/*
when string contains bad words, it returns true
Example result:
(boolean) true 
*/

Badwords::negationCheck("You are not an asshole");
/*
When string contains a negator like not, aren't, etc before the offensive word
it returns 0
Output:
-1 means NOT FOUND
0 means found with a negator before the offensive word (Neutral)
1 means offensive word was found

Note: The negator can appear before an article just like the example above, or directly before the bad word
E.g of articles: "a", "an", "the"
*/

Badwords::strip('Blood sugar sex magic');

/*
given string contains bad words, it replaces vocal chars in bad word with asterix
Example result:
(string) "Blood sugar s*x magic" 
*/

The Versions

06/03 2018

dev-master

9999999-dev

Badwords filter in PHP

  Sources   Download

MIT

The Development Requires

by Mochammad Masbuchin