$string="City"
$consonants=array("B","b","C","c","D","d","F","f","G","g","H","h","J","j","K","k","L","l","M","m","N","n",
"P","p","Q","q","R","r","S","s","T","t","V","v","W","w","X","x","Y","y","Z","z");
foreach($consonants as $chk2)
{
if(strpos($string,$chk2)!= false)
{
$ans2[]=$chk2;
}
}
if(isset($ans2))
{
$comment2="Consonants in this string: ".join(" ",$ans2);
}
else
{
$comment2="Consonants in this string: None";
}
echo "".$comment2."<br/>";
so the error is that the displayed consonants does not include the first letter. what could be wrong?