Re: preg_replace \\1 yIKES!

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

 



At 3:45 AM -0700 6/14/06, sam wrote:
>On Jun 13, 2006, at 1:58 PM, tedd wrote:
>
>>At 11:33 AM -0700 6/13/06, sam wrote:
>>>Wow this is hard I can't wait till I get the hang of it.
>>>
>>>Capitalize the first letter of a word.
>>
>>Try:
>>
>><?php
>>$word = "yikes";
>>$word[0]=strtoupper($word[0]);
>>echo($word);
>>?>
>
>
>This blows my mind. What should one think, "everything is an array"? Well, okay not every but everything that's in linear consecutive order; anything that can be indexed?
>
>I was trying to make an array from $word but explode() doesn't take an empty delimiter so I gave up and went for the preg_replace.

Sorry, it was a throwback to my C days -- using ucfist() is better.

tedd
-- 
------------------------------------------------------------------------------------
http://sperling.com  http://ancientstones.com  http://earthstones.com

-- 
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