Page 1 of 1

Capitolize a string.

Posted: Wed Jun 21, 2006 5:41 pm
by JellyFish
How do I capitolize a string?

Posted: Wed Jun 21, 2006 5:43 pm
by Benjamin

Code: Select all

$String = strtoupper($String);

Posted: Wed Jun 21, 2006 5:44 pm
by Zythan
Hello,

With strtoupper($str), somthing like:

Code: Select all

<?php
$str = "Mary Had A Little Lamb and She LOVED It So";
$str = strtoupper($str);
echo $str; // Prints MARY HAD A LITTLE LAMB AND SHE LOVED IT SO
?>
Zythan

Posted: Wed Jun 21, 2006 6:06 pm
by JellyFish
No I meant capitolized (Hello Man) Not upper case (HELLO MAN). :)

But that's okay I found out how to do that.

Thanks

Posted: Wed Jun 21, 2006 6:08 pm
by Weirdan

Posted: Wed Jun 21, 2006 7:25 pm
by John Cartwright
to get the very first character upper case simply use ucfirst()