| PHP String Functions -
11-02-2006, 06:14 PM
[SIZE=1]this can be quite useful to beginners learning PHP:[/SIZE]
[SIZE=1][/SIZE] the strtoupper() function turns the letters in the string to uppercase: print(strtoupper("i bet this will show up as all letters capitalized<br>")); OUTPUT: I BET THIS WILL SHOW UP AS ALL LETTERS IN CAPITALIZED the strtolower() function turns the letters in the string to lowercase: print(strtolower("I BET THIS WILL SHOW UP AS ALL LETTERS IN LOWERCASE<br>")); OUTPUT:i bet this will show up as all letters lowercase the ucfirst() function turns the first letter of the string to capital: print(ucfirst("i bet this will show the first letter of the string capitalized<br>")); OUTPUT:I bet this will show the first letter of the string capitalized the ucwords() function turns the first letter of every wordin the string to capital: print(ucwords("i bet this will show the first letter of every word capitalized<br>")); OUTPUT:I Bet This Will Show The First Letter Of Every Word Capitalized
Last edited by undyboy91 : 11-03-2006 at 12:12 PM.
Reason: clarifying the post.
|