olli460 Posted September 28, 2009 Share Posted September 28, 2009 Hello, Ive got a variable that contins data, The data is not formatted correctly How can i change: OnE tWo tHreE foUr Into: One Two Three Four So just the front character of each letter is upper case and the rest are lower case. Link to comment https://forums.phpfreaks.com/topic/175788-solved-sort-out-different-cases-in-a-variable/ Share on other sites More sharing options...
trq Posted September 28, 2009 Share Posted September 28, 2009 echo strtolower(ucwords('OnE tWo tHreE foUr')); Link to comment https://forums.phpfreaks.com/topic/175788-solved-sort-out-different-cases-in-a-variable/#findComment-926301 Share on other sites More sharing options...
olli460 Posted September 28, 2009 Author Share Posted September 28, 2009 Hello, That made them all lower case but did not make each word first character upper Link to comment https://forums.phpfreaks.com/topic/175788-solved-sort-out-different-cases-in-a-variable/#findComment-926311 Share on other sites More sharing options...
trq Posted September 28, 2009 Share Posted September 28, 2009 My bad. echo ucwords(strtolower('OnE tWo tHreE foUr')); Link to comment https://forums.phpfreaks.com/topic/175788-solved-sort-out-different-cases-in-a-variable/#findComment-926312 Share on other sites More sharing options...
olli460 Posted September 28, 2009 Author Share Posted September 28, 2009 Nice, that works gr8 Cheers! Link to comment https://forums.phpfreaks.com/topic/175788-solved-sort-out-different-cases-in-a-variable/#findComment-926313 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.