Jump to content

Archived

This topic is now archived and is closed to further replies.

newb

capitilize a value

Recommended Posts

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.

Share this post


Link to post
Share on other sites
i dont want the entire word capitlized, just the first letter.

Share this post


Link to post
Share on other sites
[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!!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[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.

Share this post


Link to post
Share on other sites
nevermind i got it.
$string = ucwords((strtolower(DoWnLoAdS)));

changes it to just Downloads. ty anyways.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.