newb Posted September 16, 2006 Share Posted September 16, 2006 how do i capitilize something in php. like say if i had something in the sql database that was lowercase but i wanted it capitlized in php how would i do that? is there a php cmd for it. Quote Link to comment Share on other sites More sharing options...
Wintergreen Posted September 16, 2006 Share Posted September 16, 2006 http://www.php.net/manual/en/function.strtoupper.php Quote Link to comment Share on other sites More sharing options...
newb Posted September 16, 2006 Author Share Posted September 16, 2006 i dont want the entire word capitlized, just the first letter. Quote Link to comment Share on other sites More sharing options...
newb Posted September 16, 2006 Author Share Posted September 16, 2006 nevermind i got it, its function.ucwordsthanks guys. Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 16, 2006 Share Posted September 16, 2006 [quote author=newb link=topic=108256.msg435310#msg435310 date=1158372590]i dont want the entire word capitlized, just the first letter.[/quote]Ah, the power of asking the question you really want answered!! Quote Link to comment Share on other sites More sharing options...
newb Posted September 16, 2006 Author Share Posted September 16, 2006 heh. i have another question, its somewhat similar so i decided not to make another thread.how would i go about converting a string from DoWnLoAdS to Downloads. ? basically, im trying to find a function that makes only the first letter capital and the others lowercase in a string. I havent found a php function for it so im not sure how its done. Quote Link to comment Share on other sites More sharing options...
Wintergreen Posted September 16, 2006 Share Posted September 16, 2006 strtolower()Then use your function you found, ucwords Quote Link to comment Share on other sites More sharing options...
newb Posted September 16, 2006 Author Share Posted September 16, 2006 [quote author=Wintergreen link=topic=108256.msg435367#msg435367 date=1158383352]strtolower()Then use your function you found, ucwords[/quote]can u provide a working example? im not sure how its done with a string inputted. Quote Link to comment Share on other sites More sharing options...
newb Posted September 16, 2006 Author Share Posted September 16, 2006 nevermind i got it.$string = ucwords((strtolower(DoWnLoAdS))); changes it to just Downloads. ty anyways. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.