The Little Guy Posted October 16, 2009 Share Posted October 16, 2009 Is there PHP function that can uppercase: éíñò etc. Quote Link to comment https://forums.phpfreaks.com/topic/177867-solved-uppercase-foreign-letters/ Share on other sites More sharing options...
cags Posted October 16, 2009 Share Posted October 16, 2009 strtoupper Quote Link to comment https://forums.phpfreaks.com/topic/177867-solved-uppercase-foreign-letters/#findComment-938055 Share on other sites More sharing options...
The Little Guy Posted October 16, 2009 Author Share Posted October 16, 2009 I found this on that page, and it seems to work well <?php define("LATIN1_UC_CHARS", "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ"); define("LATIN1_LC_CHARS", "àáâãäåæçèéêëìíîïðñòóôõöøùúûüý"); function uc_latin1 ($str) { $str = strtoupper(strtr($str, LATIN1_LC_CHARS, LATIN1_UC_CHARS)); return strtr($str, array("ß" => "SS")); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/177867-solved-uppercase-foreign-letters/#findComment-938225 Share on other sites More sharing options...
cags Posted October 16, 2009 Share Posted October 16, 2009 Am I missing something? Whats wrong with... strtoupper("àáâãäåæçèéêëìíîïðñòóôõöøùúûüý"); Output: ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ Quote Link to comment https://forums.phpfreaks.com/topic/177867-solved-uppercase-foreign-letters/#findComment-938229 Share on other sites More sharing options...
The Little Guy Posted October 16, 2009 Author Share Posted October 16, 2009 Am I missing something? Whats wrong with... strtoupper("àáâãäåæçèéêëìíîïðñòóôõöøùúûüý"); Output: ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ I don't know, but for me, that doesn't work... Quote Link to comment https://forums.phpfreaks.com/topic/177867-solved-uppercase-foreign-letters/#findComment-938236 Share on other sites More sharing options...
Maq Posted October 16, 2009 Share Posted October 16, 2009 Am I missing something? Whats wrong with... strtoupper("àáâãäåæçèéêëìíîïðñòóôõöøùúûüý"); Output: ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ I don't know, but for me, that doesn't work... Are you running it in the command line? It won't work there, although it will in the browser. Quote Link to comment https://forums.phpfreaks.com/topic/177867-solved-uppercase-foreign-letters/#findComment-938237 Share on other sites More sharing options...
cags Posted October 16, 2009 Share Posted October 16, 2009 Looking at the documentation it's down to the current locale, which can be changed using this method... <?php setlocale(LC_CTYPE, "de_AT") ?> Quote Link to comment https://forums.phpfreaks.com/topic/177867-solved-uppercase-foreign-letters/#findComment-938239 Share on other sites More sharing options...
The Little Guy Posted October 16, 2009 Author Share Posted October 16, 2009 nope, I'm running it from the browser. let my try again. though... yup, using it I get this: MICHAEL BUBLé Quote Link to comment https://forums.phpfreaks.com/topic/177867-solved-uppercase-foreign-letters/#findComment-938240 Share on other sites More sharing options...
The Little Guy Posted October 16, 2009 Author Share Posted October 16, 2009 Looking at the documentation it's down to the current locale, which can be changed using this method... <?php setlocale(LC_CTYPE, "de_AT") ?> Thanks! That worked! Quote Link to comment https://forums.phpfreaks.com/topic/177867-solved-uppercase-foreign-letters/#findComment-938241 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.