As an exercise, I'm writing a case converter for html code (lower to upper). I've started with a simplified snippet - but the result is bizarre:
<?php
setlocale (LC_CTYPE, "");
$str = [whatever];
$str = strtoupper ($str);
print "$str";
?>
Consider these strange results for different values of $str:
(1) When $str="<form", the output is:
(nothing, null, dada) ?!!?
(2) However, when $str="< form", the output is:
< FORM
(3) And when $str="<", the output is:
"<"
(4) Finally, when $str=">form", the output is:
">FORM"
Any thoughts on the strange result in scenario #1?
Thanks,
Mitch