Erik Edgren Erik Edgren - 1 month ago 4x
PHP Question

Make all the strings of a string array into lower case except for the first word

Supposing I have an array

Tomat, Ost

How can I accomplish so it is like this:
Tomat, ost

$ingredient_a = Array('Tomat', 'Ost');
echo implode(', ', $ingredient_a);


Use ucfirst and array_map with strtolower

echo ucfirst(implode(', ', array_map('strtolower',$ingredient_a)));