function strToUcword($str){
$arr = explode('_',$str);
$restr = '';
foreach ($arr as $key=>$value){
// $restr .= ucwords($value);
$restr .= ucfirst($value);
}
var_dump($restr);
}
strToUcword('make_by_id');
function demo($str)
{
print_r(str_replace(' ','',ucwords(str_replace('_',' ',$str)))) ;
}
demo('make_by_id');
PHP-将_链接转为大驼峰
最新推荐文章于 2022-12-01 21:09:45 发布