将字符串数组中除第一个单词外的所有字符串都变为小写


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

假设我有一个数组Tomat, Ost我怎么能做到这样:Tomat, ost ?

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

ucfirstarray_mapstrtolower结合使用

echo ucfirst(implode(', ', array_map('strtolower',$ingredient_a)));
$ingredient_a = array('Tomat', 'Ost');
$new = array();
foreach($ingredient_a as $key => $value) {
    $key == 0 ? $new[] = $value : $new[] = strtolower($value);
}
echo implode(', ', $new);