“PHP mayúscula con acento” Código de respuesta

PHP mayúscula

//string to all uppercase
$string = "String with Mixed use of Uppercase and Lowercase";
//php string to uppercase
$string = strtoupper($string);
// = "STRING WITH MIXED USE OF UPPERCASE AND LOWERCASE"
Vic20

PHP mayúscula con acento

<?php
function strtoupperWithAccents($string) {
   $string = strtoupper($string);
   $string = str_replace(
      array('é', 'è', 'ê', 'ë', 'à', 'â', 'î', 'ï', 'ô', 'ù', 'û'),
      array('É', 'È', 'Ê', 'Ë', 'À', 'Â', 'Î', 'Ï', 'Ô', 'Ù', 'Û'),
      $string
   );
   return $string;
}
Charming Cardinal

cadena PHP a mayúsculas

<?php
$str = "Mary Had A Little Lamb and She LOVED It So";
$str = strtoupper($str);
echo $str; // show: MARY HAD A LITTLE LAMB AND SHE LOVED IT SO
Ivan The Terrible

Respuestas similares a “PHP mayúscula con acento”

Preguntas similares a “PHP mayúscula con acento”

Más respuestas relacionadas con “PHP mayúscula con acento” en PHP

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código