note 94599 deleted from function.strtoupper by danbrown
| From: | danbrown@php.net | Date: | Fri, 13 Nov 2009 15:07:42 +0000 |
| Subject: | note 94599 deleted from function.strtoupper by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-162871@lists.php.net to get a copy of this message | ||
Note Submitter: [gsguma]
----
<?php
/* converte UTF8 corrigindo acentos e cedilhas minusculos */
function case_utf8($str,$case='+'){
$str = utf8_decode($str);
switch($case)
{
case "+" :
default:
$str=strtoupper($str);
break;
case "-" :
$str = strtolower($str);
break;
}
$str = utf8_encode($str);
return $str;
}
/* converte UTF8 corrigindo acentos e cedilhas minusculos */
?>
Ex:
<?php
case_utf8("string"); //maiuculas
case_utf8("string","-"); //minusculas
?>