Erik Edgren Erik Edgren - 10 months ago 52
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)));