laanes Posted March 16, 2011 Share Posted March 16, 2011 Hello, All the names in database are uppercase. Would like to run string formating functions before displaying them. $name = ucfirst(strtolower($results[$i]['name'])); It turns everything nicely into lowercase but doesn't capitalize the first letter. Why could that be? Best regards, laanes Quote Link to comment https://forums.phpfreaks.com/topic/230789-ucfirststrtolowervalue-not-giving-desired-result/ Share on other sites More sharing options...
sasa Posted March 16, 2011 Share Posted March 16, 2011 try to trim variable first $name = ucfirst(strtolower(trim($results[$i]['name']))); Quote Link to comment https://forums.phpfreaks.com/topic/230789-ucfirststrtolowervalue-not-giving-desired-result/#findComment-1188106 Share on other sites More sharing options...
laanes Posted March 16, 2011 Author Share Posted March 16, 2011 Many thanks sasa, This is the help i was looking for, trim does the trick indeed. All the best to you, laanes Quote Link to comment https://forums.phpfreaks.com/topic/230789-ucfirststrtolowervalue-not-giving-desired-result/#findComment-1188171 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.