I want split a string of capitalized words into an array of individual words.
$str = 'CreateTechBook'
Output:
array('Create','Tech', 'Book')
asked Sep 15, 2011 at 2:58
2 Answers 2
function splitCamelCase($str) {
return preg_split('/(?<=\\w)(?=[A-Z])/', $str);
}
answered Sep 15, 2011 at 3:01
preg_replace('/([a-z0-9])?([A-Z])/','1ドル 2ドル 3ドル',$string);
answered Sep 15, 2011 at 3:01
Comments
lang-php