I've two arrays, words and stop_words. I'd like to use stop_words to see matches in words and replace matches with a w**d.
So far:
$words_arr = explode(",",$result[0]->words);
$words_stop_arr = json_decode($settings['words_stop']);
print_r(str_ireplace($words_stop_arr, "****", $words_arr));
words_arr ->
Array ( [0] => sex [1] => drugs [2] => rock [3] => lamba [4] => runner [5] => rule [6] => going [7] => war [8] => work [9] => eat [10] => program [11] => photography [12] => cart [13] => wart [14] => jungle [15] => dick )
And stop words ->
Array ( [0] => dick [1] => orgy [2] => suck [3] => rape )
So dick should be changed into d**k. With my current implementation I just change everything with 4 asterisk... which is not desired...