开发者

string convert to array

I want split a 开发者_如何学编程string to array by Case Sensitivity. like

$str = 'CreateTechBook' 

convert to

 array('Create','Tech', 'Book')


function splitCamelCase($str) {
    return preg_split('/(?<=\\w)(?=[A-Z])/', $str);
}


 preg_replace('/([a-z0-9])?([A-Z])/','$1 $2 $3',$string);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜