CyberShot Posted October 9, 2009 Share Posted October 9, 2009 I was doing some reading on php functions and I found that to make a string all uppercase you would do strToUpper($str) I also found that php manual says to use mb_strToUpper($str) both work and it doesn't matter if I use uppercase or lowercase in the function, it still works. So my question is, "Why does the function work either way with mb or without mb and what does mb suppose to mean?" and is using uppercase in the function name a user preference or should I use all lowercase? strtoupper versus strToUpper? Quote Link to comment https://forums.phpfreaks.com/topic/177136-string-to-upper/ Share on other sites More sharing options...
Daniel0 Posted October 9, 2009 Share Posted October 9, 2009 The mb_ functions are for for multi-byte character sets like UTF-8. See: http://www.joelonsoftware.com/articles/Unicode.html Quote Link to comment https://forums.phpfreaks.com/topic/177136-string-to-upper/#findComment-934019 Share on other sites More sharing options...
waynew Posted October 9, 2009 Share Posted October 9, 2009 You should use lower-case as that's what the manual uses. Quote Link to comment https://forums.phpfreaks.com/topic/177136-string-to-upper/#findComment-934020 Share on other sites More sharing options...
corbin Posted October 9, 2009 Share Posted October 9, 2009 Technically function case does not matter in PHP, but it is preferable to use the actual case of the function. (In my opinion, functions should be case sensitive, but I doubt it will ever be changed.) Quote Link to comment https://forums.phpfreaks.com/topic/177136-string-to-upper/#findComment-934029 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.