tags:

views:

224

answers:

4

Do you know is there any function in PHP to make the first character of the word uppercase? Or must I write it by regular expression?

+8  A: 

Use the ucfirst function.

Arkh
Beat me by five secs. Heh.
Arne Sostack
ah, it's so simple:) thanks
Syom
On a side note ucfirst relies on locale so watch your step
Manos Dilaverakis
+3  A: 
$word = ucfirst($word);
Rob
A: 

try to use ucwords() function

Marcin
ucwords() will capitalize each word in the string, not just the first letter. Maybe that is what the original poster wanted, not sure. Voted up for benefit of the doubt.
Arne Sostack
+1  A: 

$firstlettersuppercased = ucwords($originalstring);

This will capitalize the first letter of every word in the $originalstring.

vicatcu