The Little Guy Posted October 16, 2009 Share Posted October 16, 2009 Is there PHP function that can uppercase: éíñò etc. 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 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")); } ?> 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: ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ 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... 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. 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") ?> 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é 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! Link to comment https://forums.phpfreaks.com/topic/177867-solved-uppercase-foreign-letters/#findComment-938241 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.