Location: PHPKode > scripts > Intelligent Censor > intelligent-censor/example.php
<?php
require_once "IntelligentCensor.php";

// * are not expanded
// % are expanded, and but they will only work when placed at either the
// beginning or ending of the word
$censors = array(
    '*damn%' => 'darn',
    'whore%' => 'people',
    'bastard*' => 'happyperson',
    '*ho' => 'person',
);
// Be careful about creating censors with wildcards, as they match more
// words than you may want.

// Can use * wildcards
$censors_exclusion = array(
    'echo*',
);

$icensor = new IntelligentCensor($censors, $censors_exclusion);

echo $icensor->censor("you're all DIETYDAMNING bastardly wHOres! you echo ho!");
// Result: you're all DARNING happyperson pEOples! you echo person! 
//
Return current item: Intelligent Censor