dumdumsareyum Posted July 6, 2007 Share Posted July 6, 2007 I'm looking for a string function that will allow me to take a string with uppercase and lower case letters and add a space before the uppercase letters, e.g. "LeeHarveyOswald" becomes " Lee Harvey Oswald". Thanks! Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 6, 2007 Share Posted July 6, 2007 regular expression function deInterCaps($var){ return ucfirst(ereg_replace("[A-Z]"," \\0",$var)); } $interCapsString = "aLoadOfNonsenseToDemonstrateTheFunction"; echo deInterCaps($interCapsString); // output: A load of nonsense to demonstrate the functio that alos tranform the first lettet to upper if you dont want that then rumove the ucfrist Quote Link to comment Share on other sites More sharing options...
dumdumsareyum Posted July 6, 2007 Author Share Posted July 6, 2007 muchas gracias Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 6, 2007 Share Posted July 6, 2007 mark this as solved k Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.