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. Link to comment https://forums.phpfreaks.com/topic/20943-capitilize-a-value/ 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 Link to comment https://forums.phpfreaks.com/topic/20943-capitilize-a-value/#findComment-92816 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. Link to comment https://forums.phpfreaks.com/topic/20943-capitilize-a-value/#findComment-92817 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. Link to comment https://forums.phpfreaks.com/topic/20943-capitilize-a-value/#findComment-92818 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!! Link to comment https://forums.phpfreaks.com/topic/20943-capitilize-a-value/#findComment-92824 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. Link to comment https://forums.phpfreaks.com/topic/20943-capitilize-a-value/#findComment-92873 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 Link to comment https://forums.phpfreaks.com/topic/20943-capitilize-a-value/#findComment-92874 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. Link to comment https://forums.phpfreaks.com/topic/20943-capitilize-a-value/#findComment-92875 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. Link to comment https://forums.phpfreaks.com/topic/20943-capitilize-a-value/#findComment-92877 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.