I have been searching on Google and this platform to find an answer but I am unable to make it work. So here is my situation:
What I want:
To check for each object if it contains a string which is defined in an array and only output objects which pass this condition.
What I got:
$mail_body = "<table>.....</table>";
$blacklist = array("PCabc", "PCxyz");
foreach($blacklist as $blacklists){
if (strpos($mail_body, $blacklists) !== false){
echo "<br>".$mail_body."<br>";
}
}
Turns out. This code is actually a working whitelist.^^
But I want the opposite but it would only output an object for each string within the array if I change !== false to == false. So if I got 5 items in $blacklist it would output 5 times the same for every object.