AnsPress_Bad_words::find_bad_words( string $str )
Description #
Find bad words in a string.
Parameters #
- $strstring (Required) String need to be checked.
Source #
File: addons/free/bad-words.php
public static function find_bad_words( $str ) { $found = array(); foreach ( (array) SELF::get_bad_words() as $w ) { $w = trim( $w ); $count = preg_match_all( '/\b' . preg_quote( $w,'/' ) . '\b/i', $str ); if ( $count > 0 ) { $found[ $w ] = $count; } } if ( ! empty( $found ) ) { return $found; } return false; }
Expand full source code Collapse full source code View on GitHub: addons/free/bad-words.php:115
Add your comment