i have an example code like this :
$a = "A";
$b = array("A", "B", "C");
foreach ($b as $value)
{
$checkName = strpos($a, $value);
if($checkName !== false)
{
echo "K";
}
else
{
echo "b";
}
}
if i run above code, will show "KBB".
how when we already found the string we only echoing "K" ? so what i want is,
- Find a string in array,
- if found echo k,
- if not found echo b.