Created
June 28, 2011 16:06
-
-
Save douglasmiranda/1051488 to your computer and use it in GitHub Desktop.
[PHP strtolower, strtoupper, mb_convert_case] - Fix problems with accentuation / Corrigindo problemas de acentuação
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Using mb_convert_case</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
</head> | |
<body> | |
<?php | |
// PHP still have problems with unicode, so Multi Byte functions solve part of this problem. | |
// For more information: http://www.php.net/manual/en/ref.mbstring.php | |
$string_example = "oáÉíÓÚ çãO"; | |
echo mb_convert_case($string_example, MB_CASE_UPPER, 'UTF-8'); | |
echo mb_convert_case($string_example, MB_CASE_LOWER, 'UTF-8'); | |
// PS: Note in line 4 meta tag and the encode parameter in the mb_convert_case | |
// Both UTF-8 | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment