The mb_strtoupper
function supports a second parameter in which you can specify the encoding. If this second parameter is omitted, the encoding value that the server has by default will be used.
If you indicate UTF-8 should work:
$string=$resulSet['primer_apellido'];
echo mb_strtoupper($string, 'UTF-8');
Encryption on the server
To establish / obtain the internal character encoding of the server in PHP, there is a function mb_internal_encoding
Example:
<?php
/* Establecer la codificación de caracteres interna a UTF-8 */
mb_internal_encoding("UTF-8");
/* Mostrar la codificación de caracteres interna en uso */
echo mb_internal_encoding();
?>
Another alternative: CSS
It can also be done by CSS, using text-transform: uppercase
:
$string=$resulSet['primer_apellido'];
echo '<span style="text-transform: uppercase;">'. $string. '</span>';
Some examples with CSS:
.mayusculas
{
text-transform: uppercase;
}
<p>Ejemplo, aplicando directamente el estilo (no recomendado):</p>
<p>muñoz - > <span style="text-transform: uppercase;">muñoz</span> esto no lo quiero en mayúsculas</p>
<p>áéíóú - > <span style="text-transform: uppercase;">áéíóú</span> esto tampoco...</p>
<hr />
<p>Ejemplo usando <strong>buenas prácticas (con nombres de clases)</strong>:</p>
<p>muñoz - > <span class="mayusculas">muñoz</span> esto no lo quiero en mayúsculas</p>
<p>áéíóú - > <span class="mayusculas">áéíóú</span> esto tampoco...</p>