Re: strtoupper and HTML entities

From: Date: Sun, 23 Dec 2001 10:16:33 +0000
Subject: Re: strtoupper and HTML entities
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-78609@lists.php.net to get a copy of this message
It works! thanks a lot, Michael!! mweb On Sunday 23 December 2001 00:41, Michael Sims wrote: > 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&ouml;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&ouml;rung"; > > $string = htmltoupper($string); > > echo $string; > ?>

« previous php.general (#78609) next »