Skip to content

Instantly share code, notes, and snippets.

@jiglesiasabio
Last active August 29, 2015 13:57
Show Gist options
  • Save jiglesiasabio/9602674 to your computer and use it in GitHub Desktop.
Save jiglesiasabio/9602674 to your computer and use it in GitHub Desktop.
PHP Uppercasing
cadena => áéíóú ñ aeiou qwerty
strtoupper => áéíóú ñ AEIOU QWERTY
mb_convert_case => ÁÉÍÓÚ Ñ AEIOU QWERTY
<?php
$str = 'áéíóú ñ aeiou qwerty'.PHP_EOL;
echo 'cadena => '. $str . PHP_EOL;
echo 'strtoupper => ' . strtoupper($str) . PHP_EOL;
echo 'mb_convert_case => ' . mb_convert_case($str, MB_CASE_UPPER, "UTF-8") . PHP_EOL;
@xeoncross
Copy link

Don't forget mb_strtoupper() shorthand for mb_convert_case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment