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 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']))); 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 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
Archived
This topic is now archived and is closed to further replies.