Split Words Based on Capital Letter

Using preg_split to separate words where a capital letter is found.

$string = ‘UsefulFunctions’;
$parts = preg_split(‘/(?=[A-Z])/’, $string);
echo implode(‘ ‘, $parts); //Useful Functions
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn