用php编写一个函数实现 以下功能:字符串hello_world转换成为HelloWorld, get_field_by_id转换成为GetFieldById
$string = "Hello_world";
$string1="get_field_by_id";
echo GaiBian($string);
echo GaiBian($string1)
function GaiBian($string){
$token =strtok($string, "_");//分割字符串
while ($token != false)
{
$token=ucfirst($token);//给首字母大写
echo "$token";
$token = strtok("_");
}
}
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇:没有了
- 下一篇:没有了
