I want to add space to word something like this
CountryName
RegionName
ZipPostalCode
to be
Country Name
Region Name
Zip Postal Code
Let me know how can be done with php
You can use regular expressions to find [lowercase character][uppercase character] and insert a space:
$newstr = preg_replace('/([a-z])([A-Z])/s','$1 $2', $oldstr);
You might look into CakePHP's Inflector class for guidance (for example the humanize function).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With