I’m looking for help with the NOT (!) logical operator. I’m trying to use it with stripos to require “GOOD” but NOT “BAD”. So if “GOOD” appears without “BAD” the loop completes however if “GOOD “and “BAD” appear the loop is skipped… Below is what i have for the first part, i haven’t been able to come up with the second half successfully. I’ve read many resources but just end up confused…
if (stripos($data, 'GOOD') !== false)
<?php
$data = 'GOOD and BAD';
if (stripos($data, 'GOOD') !== false && stripos($data, 'BAD') === false)
{
echo 'Success.';
}
else echo 'Failure.';
?>
What about
to check if
'BAD'is not included? Both conditions can be used together in one if like