//把dddEee改为ddd_eee
public function convertUpperToLower($str){
$array=preg_split("/(?=[A-Z])/",$str);
$i = 0;
$result_arr = array();
foreach($array as $ar){
$i++;
if($i!=1){
$result_arr[] = "_".strtolower($ar);
}else{
$result_arr[] = $ar;
}
}
return implode("",$result_arr);
}
echo $this->convertUpperToLower("dfdEreSfdafsTYsafD");
exit;
输出:dfd_ere_sfdafs_t_ysaf_d