PHP code example of khumam / censorit

1. Go to this page and download the library: Download khumam/censorit 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/ */

    

khumam / censorit example snippets




// Pastikan load vendor terlebih dahulu
rit\Censorit;

// Misalkan kita memiliki suatu kata yang akan disensor
$string = 'ABCDEF GHIJK';

// Dan cara sensornya
$censoredString = Censorit::censor($string)->full() // Hasil ***********
$censoredString = Censorit::censor($string)->half() // Hasil ABCDEF GHI**
$censoredString = Censorit::censor($string)->middle() // Hasil AB**** ***JK