1、驼峰转下划线命名方式有几种,小编在下面会一次讲解

3、第二种方法:function HumpToUnderline2($camelCaps,$separator='_'){ return strtolower(preg_replace('/([a-z])([A-Z])/', "$1" . $separator . "$2", $camelCaps)); }

5、使用:public function change(){ echo $this->HumpToUnderline1("testStringHello"); echo "<br />"; echo $this->HumpToUnderline2("testStringHello"); echo "<br />"; echo $this->HumpToUnderline3("testStringHello"); }
