Quote:
|
Originally Posted by cybernewsmaster
---
I think this could be solved like this:
...
I think you could also do this with a regular expression, but I'm not a reg exp buff....
-Jeffery
|
OK. Forget about what I posted earlier.
I thought I had written something a while ago that addressed your issue... After a little fiddling, I came up with this solution:
function parseString($tempStr){
$search = array ("A","B","C","D","E","F","G","H","I","J",
"K","L","M","N","O","P","Q","R","S","T",
"U","V","W","X","Y","Z");
foreach($search as $capChar){
$tempStr = str_replace($capChar, " ".$capChar, $tempStr);
}
//get rid of multiple spaces
$tempStr = preg_replace("'([ ])[\s]+'", "
\\1", $tempStr);
return trim($tempStr);//get rid of extra white space
}
$myStr = "JustAnotherBeautifulDay InTheNeighborhood";
echo $myStr; // JustAnotherBeautifulDay InTheNeighborhood
echo "<br>";
echo parseString($myStr);// Just Another Beautiful Day In The Neighborhood
--
I tested it on my own server and it worked. See the output in the comments.
-Jeffery ~
BuffaloSoft - Cutting Edge Technologies
