the_oliver Posted September 18, 2007 Share Posted September 18, 2007 Hello, Im looking to feed a string to a function which will take every word in that string, make the first letter of each word capital, and the rest lowercase. EG if fead SOME TEST it would return Some Test if fead some test it would return Some Test. However im not sure how to go about this. Can anyone offer some help please? Many Thanks Link to comment https://forums.phpfreaks.com/topic/69787-making-the-first-letter-of-every-word-cappital-and-the-rest-lower/ Share on other sites More sharing options...
Jessica Posted September 18, 2007 Share Posted September 18, 2007 http://php.net/ucwords Link to comment https://forums.phpfreaks.com/topic/69787-making-the-first-letter-of-every-word-cappital-and-the-rest-lower/#findComment-350604 Share on other sites More sharing options...
Gmunky Posted September 18, 2007 Share Posted September 18, 2007 $string="SOME WORDS"; $newstring=ucwords(strtolower($string)); Link to comment https://forums.phpfreaks.com/topic/69787-making-the-first-letter-of-every-word-cappital-and-the-rest-lower/#findComment-350609 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.