Code: Select all
foreach ($Array as $key => $val) {
$band = array("bad","words","here");
if(strpos($val, $band) !== FALSE) {
$val = str_replace($band,"***",$val);
echo $val; }
else {
echo $val;
}
echo "<br />"; }If I change $band in the strpos() and str_repace() functions with a word in quotes, like "hello" it works, but using the array variable does not.
Could anyone tell me how I could achieve this goal?
Thanks!