定制 oliveris/bad-words 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

oliveris/bad-words

Composer 安装命令:

composer require oliveris/bad-words

包简介

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

README 文档

README

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

Usage

Pull in the composer package by running the command below:

composer require oliveris/bad-words

Import the BadWords namespace into the class (autoloading)

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.

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.

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.

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.

BadWords::maskBadWords($test_string)

Unmasking the masked words

Below is an example that returns the string in its original unmasked form.

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.

统计信息

  • 总下载量: 984
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固