Page 1 of 1

ucfirst question

Posted: Wed Jul 13, 2005 4:26 am
by pleigh
i understand that ucfirst() will make the first letter of a word to be in uppercase...what if i have a sentence "my new project"....is it possible for me to make each word to be in uppercase?
My New Project
in my case, i have a textbox that will handle sentence...and in one click, data will be stored in the database...i want to make each word to uppercase when i view it with view.php....

i already done this

Code: Select all

ucfirst($row[0])
($row[0] contains the words my new projects)

and the result in the view.php page is 'My new project'

Posted: Wed Jul 13, 2005 4:39 am
by phpScott
check out http://uk2.php.net/manual/en/function.ucwords.php in the manual
god couple of examples as well.

Posted: Wed Jul 13, 2005 4:46 am
by pleigh
yup thanks...it was ucwords() indeed..hehehe...missed that.

Posted: Wed Jul 13, 2005 4:55 am
by phpScott
see the trees for the forest sort of thing :D