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? Quote Link to comment Share on other sites More sharing options...
trq Posted September 2, 2009 Share Posted September 2, 2009 strtoupper. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
trq Posted September 3, 2009 Share Posted September 3, 2009 See my above post. Quote Link to comment 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.