RE: Replacing 2 strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> AHHH! ucwords(); I probably looked right at it a million times.. I knew
> there had to be something to do that....

Lol, I know that feeling well!

One thing, btw, looking at the solution you provided. Once you'd
preg_split()ed the string into component words, you could have simply
applied strtoupper() directly to the first character of each word in your
foreach loop.

As an example:

<?
  $string = "this";
  $string{0} = strtoupper($string{0});
  echo $string; // should return value of "This"
?>

Just thought it was worth mentioning.

Regards,

Murray

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux