So I am trying to make a whitelist in this form to only allow certain words like "clean,broom, mop, etc" and replace everything else with a "*" but I can't seem to figure out how to do it with whitelist I have it working with a blacklist, but I'd rather a white list, this is what I have code wise so far.
$blacklist = array("swear1", "swear2", "swear3");
$value2 = $_POST['chore'];
$value3 = str_replace($blacklist,"*", $value2);
print("$value3");