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);
精彩评论