Skip to content

Instantly share code, notes, and snippets.

@douglasmiranda
Created June 28, 2011 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglasmiranda/1051488 to your computer and use it in GitHub Desktop.
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
<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