I have a String:
$data = "String contains works like apples, peaches, banana, bananashake, appletart";
I also have 2 std arrays as follows that contain a number of words:
$profanityTextAllowedArray = array();
$profanityTextNotAllowedArray = array();
eg:
$profanityTextAllowedArray
(
[0] => apples
[1] => kiwi
[2] => mango
[3] => pineapple
)
How can I take the string $data and first remove any words from the $profanityTextAllowedArray and then check the string $data for any words in the $profanityTextNotAllowedArray which should be flagged?