除了第一个单词外,将字符串数组的所有字符串都设置为小写

Eri*_*rik 0 php arrays string

假设我有一个数组Tomat, Ost 我怎么能完成所以它是这样的:Tomat, ost

$ingredient_a = Array('Tomat', 'Ost');
echo implode(', ', $ingredient_a);
Run Code Online (Sandbox Code Playgroud)

小智 5

使用ucfirstarray_mapstrtolower

echo ucfirst(implode(', ', array_map('strtolower',$ingredient_a)));
Run Code Online (Sandbox Code Playgroud)