1) turns the small Symbols into upper case symbols. And Also:
2) turns the upper case symbols into smoller case symbols.
function N($str)
{
for($i=0; $i<=strlen($str); $i++)
{
if(ord($str[$i])>=97 && ord($str[$i]<=122)){
$str[$i]=chr(ord($str[$i])-32);
}
else if(ord($str[$i])>=65 && ord($str[$i]<=90)){
$str[$i]=chr(ord($str[$i])+32);
}
}
echo $str;
}
$str="ABC abc";
N($str);
everything works well, but if i write "else" instead of "else if", it does not works. I don't understand why?


Sign In
Create Account


Back to top









