note 27330 deleted from function.strtoupper by derick
| From: | derick@php.net | Date: | Tue, 30 Aug 2005 11:06:05 +0000 |
| Subject: | note 27330 deleted from function.strtoupper by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-94391@lists.php.net to get a copy of this message | ||
Note Submitter: mec at stadeleck dot org
----
here is a "quick and dirty" strtoupper for strings containing html entities:
// string to upper case
// without transforming html entities
function to_upper($text)
{
$new_string = "";
while(eregi("^([^&]*)(&[a-z0-9]{2,9};|&)(.*)",$text,$regs))
{
$new_string .= strtoupper($regs[1]);
$new_string .= (substr($regs[2],-4)=="uml;") ? substr($regs[2],0,1) .
strtoupper(substr($regs[2],1,1)) . substr($regs[2],-4) : $regs[2];
$text = $regs[3];
}
$new_string .= strtoupper($text);
return $new_string;
}