abc-def-xyz
到abcDefXyz
the-fooo
到theFooo
等
什么是最有效的方式做到这一点PHP?
这是我的看法:
$parts = explode('-', $string);
$new_string = '';
foreach($parts as $part)
$new_string .= ucfirst($part);
$new_string = lcfirst($new_string);
但我有一种感觉,它可以用少得多的代码:)
PS来完成:节日快乐!每个人:d