List Info

Thread: note 78498 added to function.strtoupper




note 78498 added to function.strtoupper
user name
2007-10-15 07:25:02
ISO-8859-1 (Latin 1) full with all special characters:

<?php
function fullUpper($str){
   // convert to entities
   $subject = htmlentities($str,ENT_QUOTES);
   $pattern = '/&([a-z])(uml|acute|circ';
   $pattern.=
'|tilde|ring|elig|grave|slash|horn|cedil|th);/e';
   $replace =
"'&'.strtoupper('\1').'\2'.';'";
   $result = preg_replace($pattern, $replace, $subject);
   // convert from entities back to characters
   $htmltable = get_html_translation_table(HTML_ENTITIES);
   foreach($htmltable as $key => $value) {
      $result =
ereg_replace(addslashes($value),$key,$result);
   }
   return(strtoupper($result));
}

echo fullUpper("try this: äöüß");
?>

results in

TRY THIS: ÄÖÜß
----
Server IP: 217.160.72.57
Probable Submitter: 84.147.248.236
----
Manual Page -- 
http://www.php.net/manual/en/function.strtoupper.php
Edit        -- https://master
.php.net/note/edit/78498
Del: integrated  -- h
ttps://master.php.net/note/delete/78498/integrated
Del: useless     -- http
s://master.php.net/note/delete/78498/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/78498/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/78498/spam
Del: non-english -- 
https://master.php.net/note/delete/78498/non-english
Del: in docs     -- http
s://master.php.net/note/delete/78498/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78498
Reject      -- https://mast
er.php.net/note/reject/78498
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )