word_censor($str, $censored[, $replacement = ''])
Parameters: |
|
---|---|
Returns: |
Censored string |
Return type: |
string |
Enables you to censor words within a text string. The first parameter will contain the original string. The second will contain an array of words which you disallow. The third (optional) parameter can contain a replacement value for the words. If not specified they are replaced with pound signs: ####.
Example:
$disallowed = array('darn', 'shucks', 'golly', 'phooey'); $string = word_censor($string, $disallowed, 'Beep!');
Please login to continue.