驼峰字符串转下划线加小写

echo strtolower(preg_replace('/((?<=[a-z])(?=[A-Z]))/', '_', $str)).'<br>';

posted @ 2017-05-11 11:59  WilliamHu  阅读(480)  评论(0编辑  收藏  举报