I have an array containing integers and letters and I need to remove the integers and form a string which is all lowercase except the first letter.
$chars = ["A", 1, 2, "h", "m", "E", "D"];
//Needed Output is: Ahmed
My attempt:
foreach ($chars as $char) {
if (gettype($char) == "string") {
echo strtolower($char);
}
}
The Output is:
ahmed
but I don't how to make the first letter Capital, Is there any function that can do that with arrays?