Badwords
PHP Bad Words Detector
Install / Use
/learn @buchin/BadwordsREADME
buchin/badwords
PHP bad words detector
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"
*/
Related Skills
node-connect
339.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
