2017 © Pedro Peláez
 

package bad-words

Filters through text and cleans the input of bad words found.

image

oliveris/bad-words

Filters through text and cleans the input of bad words found.

  • Monday, May 21, 2018
  • by oliveris
  • Repository
  • 1 Watchers
  • 1 Stars
  • 346 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 948 % Grown

The README.md

Bad Words

Filters through text and cleans the input of bad words found., (*1)

Usage

Pull in the composer package by running the command below:, (*2)

composer require oliveris/bad-words

Import the BadWords namespace into the class (autoloading), (*3)

use BadWords\BadWords;

Examples

Checking if there are bad words in a string

Below is an example that returns a bool value if a bad word was detected within the given string., (*4)

BadWords::checkForBadWords($test_string)

Checking if there are bad words found within a string

Below is an example that returns an array value of bad words was detected within the given string., (*5)

BadWords::getBadWords($test_string)

Replacing any bad words found within a string

Below is an example that returns a clean string, it replaces any bad words found within a string with random words that the user has set., (*6)

BadWords::setReplacementWords([
    'hello',
    'world',
    'tree',
    'desk',
    'computer'
]);

BadWords::replaceBadWords($test_string);

Replacing any bad words found within a string with a mask of characters

Below is an example that returns a clean string, it replaces any bad words found with a mask the same length as the bad words., (*7)

BadWords::maskBadWords($test_string)

Unmasking the masked words

Below is an example that returns the string in its original unmasked form., (*8)

BadWords::unMaskBadWords($masked_string);

Set the filter words (will replace the preset)

BadWords::setFilterWords([
    'moody',
    'fat',
    'cunt'
]);

Add to the array of filter words

BadWords::addToFilterWords([
    'bollocks',
    'shit',
    'slag'
]);

License

BadWords is open-sourced software licensed under the MIT license., (*9)

The Versions

21/05 2018

dev-master

9999999-dev

Filters through text and cleans the input of bad words found.

  Sources   Download

MIT

by Sam Oliveri

swear bad words

21/05 2018

v1.0.3

1.0.3.0

Filters through text and cleans the input of bad words found.

  Sources   Download

MIT

by Sam Oliveri

swear bad words

21/05 2018

dev-feature/unMaskBadwords

dev-feature/unMaskBadwords

Filters through text and cleans the input of bad words found.

  Sources   Download

MIT

by Sam Oliveri

swear bad words

03/05 2018

v1.0.2

1.0.2.0

Filters through text and cleans the input of bad words found.

  Sources   Download

MIT

by Sam Oliveri

swear bad words

01/05 2018

v1.0.1

1.0.1.0

Filters through text and cleans the input of bad words found.

  Sources   Download

MIT

by Sam Oliveri

swear bad words