strpos pulling hair :)

Any obvious reason why I can’t get this to work? And, would there be a better way to do it?

$compound = “NRS2#VANC200MG/BETA0.5/TOBR125/ITRA50MG”;

$pos = strpos(“NRS”,$compound);

if ($pos === false) {
echo “NOT FOUND”;
} else {
echo “FOUND”;
}

You have the strpos function backwards

First place to look when using any functions you are not familiar with is the docs

Sponsor our Newsletter | Privacy Policy | Terms of Service