Re: preg_replace \\1 yIKES!

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

 



sam wrote:
> 
> for
> Eyes burning; caffein shakes; project overdue

nobody here cares whether your project is overdue -

waiting 7 minutes before sending a 'reminder' about the
question you asked suggests you need to take a PATIENCE
lesson.

or did some fraudster sell you a php support contract?
... for 500 euros you can contact me anytime at php-generals@xxxxxxxxxxxxx
for all you php woes :-P

> 
> Thanks
> 
>> Why not just use ucfirst
>> http://us2.php.net/manual/en/function.ucfirst.php?
>>
>> -----Original Message-----
>> From: sam [mailto:php@xxxxxxxx]
>> Sent: Tuesday, June 13, 2006 2:34 PM
>> To: PHP
>> Subject:  preg_replace \\1 yIKES!
>>
>>
>> Wow this is hard I can't wait till I get the hang of it.
>>
>> Capitalize the first letter of a word.
>>
>> echo preg_replace('/(^)(.)(.*$)/', strtoupper('\\2') . '\\3', 'yikes!');
>> // outputs yikes!
>>
>> Nope didn't work.
>>
>> So I want to see if I'm in the right place:
>>
>> echo preg_replace('/(^)(.)(.*$)/', '\\1' . '-' . strtoupper('\\2') .
>> '-' . '\\3', 'yikes!');
>> //outputs -y-ikes!
>>
>> So yea I've got it surrounded why now strtoupper: Yikes!
>>
>> Thanks
>>
>> --PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>>
>>
> 
> --PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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