I would like to know how I could do the following differently because I feel the way I'm doing it is wrong and would make a developer cringe.
$prodcat is an array with id's and I want to make a warning for when certain id's are in the array. This is what I do now and it does do the job but I'm sure there's a more efficient way of coding it.
$valuecheck = false;
foreach ($prodcat as $daafid) {
if (($daafid == '96') || ($daafid == '97') || ($daafid == '99') || ($daafid == '122') || ($daafid == '123') || ($daafid == '124') || ($daafid == '125') || ($daafid == '126') || ($daafid == '127') || ($daafid == '128') || ($daafid == '129') || ($daafid == '130') || ($daafid == '132') || ($daafid == '133')) {
$valuecheck = true;
}
}
if ($valuecheck == true) {
echo $text_true;
}
Thanks a lot in advance.
echo $text_true) shown once, or every time it encounters the condition?