Re: preg_replace \\1 yIKES!

From: Date: Tue, 13 Jun 2006 18:49:25 +0000
Subject: Re: preg_replace \\1 yIKES!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-237914@lists.php.net to get a copy of this message
for Eyes burning; caffein shakes; project overdue Thanks
Why not just use ucfirst http://us2.php.net/manual/en/function.ucfirst.php? -----Original Message----- From: sam [mailto:php@itab.com] Sent: Tuesday, June 13, 2006 2:34 PM To: PHP Subject: [PHP] 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


« previous php.general (#237914) next »