Re: strtoupper and HTML entities
| From: | Michael Sims | Date: | Sat, 22 Dec 2001 23:41:54 +0000 |
| Subject: | Re: strtoupper and HTML entities | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-78603@lists.php.net to get a copy of this message | ||
At 11:32 PM 12/22/2001 +0100, mweb wrote:
Hello, I know I can convert a string to all uppercases with the strtoupper() function. However, what if the original string contains HTML entities? EXAMPLE: original string = "funkstörung"Try this: <? function htmltoupper($str) {
$trans = get_html_translation_table (HTML_ENTITIES);
$trans = array_flip ($trans);
$str = strtr ($str, $trans);
$str = strtoupper($str);
$str = htmlentities($str);
return $str;
}
$string = "funkstörung";
$string = htmltoupper($string);
echo $string;
?>