PHP-Fusion Development

censorwords()

Replace offensive words with the defined replacement word. The list of offensive words and the replacement word are both defined in the Security Settings.

Versions: 9

censorwords( string $text ) : bool

Parameters

$text (string) (Required) Text that should be censored.

Return Values

(bool) Censored text.

Examples

// In this example we have added words apple and orange as offensive words and set replacement as ****
$text = 'The apple, orange and banana are all fruits.';
echo censorwords($text);
// The ****, **** and banana are all fruits.