SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
Thread: capital
-
Oct 9, 2007, 04:27 #1
- Join Date
- Sep 2007
- Posts
- 971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
capital
i have a memebrs lsit code to display info from my database but i want it to show the start of each word with a capital letter like Mike
what would the code be?
-
Oct 9, 2007, 04:31 #2
- Join Date
- May 2006
- Location
- Lancaster University, UK
- Posts
- 7,062
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
this:
PHP Code:echo ucfirst("mike");
Jake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona
-
Oct 9, 2007, 04:32 #3
- Join Date
- Sep 2007
- Posts
- 971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
cheers
-
Oct 9, 2007, 04:39 #4
- Join Date
- Sep 2007
- Posts
- 971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
would this work it dosnt seem to work:
Nick=ucfirst("$qry[username]")
-
Oct 9, 2007, 04:40 #5
- Join Date
- May 2006
- Location
- Lancaster University, UK
- Posts
- 7,062
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
PHP Code:$nick=ucfirst($qry['username']);
echo $nick;
Jake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona
-
Oct 9, 2007, 04:45 #6
- Join Date
- Sep 2007
- Posts
- 971
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
that is aprt of the code to putput to a txt file but it outputs as Nick=ucfirst('test') when it supposed to be Nick=Test
-
Oct 9, 2007, 05:04 #7
- Join Date
- May 2006
- Location
- Lancaster University, UK
- Posts
- 7,062
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
what's the code to output it?
Jake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona
-
Oct 9, 2007, 06:20 #8
you might want to use strtolower before ucfirst to make sure only the first letter is capitalized
$var = ucfirst(strtolower($whatever));
Bookmarks