Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-settings.php on line 472

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-settings.php on line 487

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-settings.php on line 494

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-settings.php on line 530

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 611

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 728

Strict Standards: Redefining already defined constructor for class wpdb in /home/controlz/public_html/blog/wp-includes/wp-db.php on line 306

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-includes/cache.php on line 103

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /home/controlz/public_html/blog/wp-includes/cache.php on line 425

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-includes/theme.php on line 623

Strict Standards: Redefining already defined constructor for class WP_Dependencies in /home/controlz/public_html/blog/wp-includes/class.wp-dependencies.php on line 15

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/controlz/public_html/blog/wp-settings.php:472) in /home/controlz/public_html/blog/wp-content/plugins/si-captcha-for-wordpress/si-captcha.php on line 31

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/controlz/public_html/blog/wp-settings.php:472) in /home/controlz/public_html/blog/wp-content/plugins/si-captcha-for-wordpress/si-captcha.php on line 31

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::Enable() should not be called statically in /home/controlz/public_html/blog/wp-includes/plugin.php on line 311
Problema strtoupper con acentos | formatic.cat

Problema strtoupper con acentos


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Si en PHP queremos pasar un String con acentos, diéresi o diferentes letras de codificación UTF-8 a mayúsculas, directamente no podemos utilizar

PHP:
  1. $var = strtoupper($valor);

ya que transformará a mayúsculas únicamente las letras del abecedario simple (sin contar ñ ni ç).

La forma correcta de cubrir todos los casos es:

PHP:
  1. $var =   mb_strtoupper($valor,'utf-8');

6 comentarios para “Problema strtoupper con acentos”


  1. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    francisco mota aleman dice:

    gracias carnal por el aporte suerte


  2. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    J.v.C dice:

    Gracias por la informacion, saludos.


  3. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    Miguel dice:

    Gracias!!


  4. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    Janneth dice:

    Muy bueno el aporte muchas gracias por publicar información como esta. Me sirvio de mucho.

    Saludos


  5. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    Senseistro dice:

    Bro gracias, de 5 páginas que ví ésta fue la que dio con la solución a ese problemilla....


  6. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    dante dice:

    hola amigo esta la funcion mb_strtoupper() no funciona en mi php que debe ser

Deja un comentario

CAPTCHA Image Audio Version
Reload Image