Jump to content


Photo

capitilize a value


  • Please log in to reply
8 replies to this topic

#1 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 16 September 2006 - 01:57 AM

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.

#2 Wintergreen

Wintergreen
  • Members
  • PipPipPip
  • Advanced Member
  • 107 posts

Posted 16 September 2006 - 01:58 AM

http://www.php.net/m....strtoupper.php

#3 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 16 September 2006 - 02:09 AM

i dont want the entire word capitlized, just the first letter.

#4 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 16 September 2006 - 02:11 AM

nevermind i got it, its function.ucwords
thanks guys.

#5 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 16 September 2006 - 02:32 AM

i dont want the entire word capitlized, just the first letter.


Ah, the power of asking the question you really want answered!!
Legend has it that reading the manual never killed anyone.
My site

#6 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 16 September 2006 - 05:07 AM

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.

#7 Wintergreen

Wintergreen
  • Members
  • PipPipPip
  • Advanced Member
  • 107 posts

Posted 16 September 2006 - 05:09 AM

strtolower()
Then use your function you found, ucwords

#8 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 16 September 2006 - 05:10 AM

strtolower()
Then use your function you found, ucwords


can u provide a working example? im not sure how its done with a string inputted.

#9 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 16 September 2006 - 05:14 AM

nevermind i got it.
$string = ucwords((strtolower(DoWnLoAdS)));

changes it to just Downloads. ty anyways.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users