PHP code example of jzavorohina / censure

1. Go to this page and download the library: Download jzavorohina/censure library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jzavorohina / censure example snippets


// Searches if there any abusive words in the text
Censure::is_bad('Original phrase with abusive words'); // return: bool

// Replace abusive words from string
Censure::replace('Original phrase with abusive words'); // return: string (cleaned text)

// Clean indexes in $_POST from abusive words
Censure::cleanPost('Unlimited number of arguments to match indexes in $_POST to clean'); // return: void

// Fixing abusive words inside string
Censure::fix('Original phrase with abusive words'); // return: string (fixed text)