通用的方法是什么?
使用preg_replace:
echo preg_replace('/(^|_)(.)/e',"strtoupper('\\2')",'test_hello_world');
其中用到e开关表示执行(execute)语句而非简单替代。
e
标签
查看
392 次