how do i add space before capital letters but leaving the first occurence of capital letter
my string is "MyHomeIsHere"
i want it to be "My Home Is Here"
...but with the code below i get as " My Home Is Here"
space gets added before M too
$String = 'ThisWasCool';
$Words = preg_replace('/(?<!\ )[A-Z]/', ' $0', $String);