聘我网

新概念招聘3.0

如何将test_hello_world转化为TestHelloWorld?

vote up0vote downstar

通用的方法是什么?

 

1 个答复

vote up0vote downcheck

使用preg_replace

echo preg_replace('/(^|_)(.)/e',"strtoupper('\\2')",'test_hello_world');

其中用到e开关表示执行(execute)语句而非简单替代。

链接

您的回答





不是您要找的问题? 浏览其他含有标签 的问题或者 自己问个.