jeff5656 Posted September 2, 2009 Share Posted September 2, 2009 This is pulled from a record: echo $curr_user; Sometimes that name is not capitalized. What is the easiest way to capitalize it (for display purposes). On a similar note, are variables stored under VARCHAR case-sensitive? Link to comment https://forums.phpfreaks.com/topic/172840-solved-capitalize/ Share on other sites More sharing options...
trq Posted September 2, 2009 Share Posted September 2, 2009 strtoupper. Link to comment https://forums.phpfreaks.com/topic/172840-solved-capitalize/#findComment-910937 Share on other sites More sharing options...
jeff5656 Posted September 2, 2009 Author Share Posted September 2, 2009 Thanks that works. One small point, I think it's ucfirst(), as the strtoupper() puts all the letters to caps, not just the first one. Link to comment https://forums.phpfreaks.com/topic/172840-solved-capitalize/#findComment-910948 Share on other sites More sharing options...
trq Posted September 2, 2009 Share Posted September 2, 2009 Well that all depends on how your read your question doesn't it. Capitalize to me says 'make all letters capitals'. Glad I got you looking at the manual though. Its amazing what you'll find in there. Link to comment https://forums.phpfreaks.com/topic/172840-solved-capitalize/#findComment-910952 Share on other sites More sharing options...
jeff5656 Posted September 2, 2009 Author Share Posted September 2, 2009 No need to be snooty :-) just kidding. With 18,000 posts you can be as snooty as you want. So anyhoo...is a value stored in VARCHAR case sensitive? Link to comment https://forums.phpfreaks.com/topic/172840-solved-capitalize/#findComment-910959 Share on other sites More sharing options...
trq Posted September 2, 2009 Share Posted September 2, 2009 is a value stored in VARCHAR case sensitive? That doesn't make much sense. Values are stored in whatever case they are written in. Are you asking if a SELECT query run against a varchar field is case sensitive? This entirely depends on what database your using. Link to comment https://forums.phpfreaks.com/topic/172840-solved-capitalize/#findComment-910963 Share on other sites More sharing options...
jeff5656 Posted September 2, 2009 Author Share Posted September 2, 2009 If I have a value called name and it is stored in the table as a VARCHAR field type, and in a php form I ask "what is your name". If I enter Jeff is that the same as jeff? Link to comment https://forums.phpfreaks.com/topic/172840-solved-capitalize/#findComment-911165 Share on other sites More sharing options...
trq Posted September 3, 2009 Share Posted September 3, 2009 See my above post. Link to comment https://forums.phpfreaks.com/topic/172840-solved-capitalize/#findComment-911315 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.