Is there a PHP function that detects if a specific character in string is lower/upper case? If not, what's the best way to do this?
| SitePoint Sponsor |
Is there a PHP function that detects if a specific character in string is lower/upper case? If not, what's the best way to do this?




If u r using login script or some thing like that.
Than in ur query just specify the field as BINARY.
It will do the trick.
Alternative to priti's code you can also find like this too:
Apply in your case.PHP Code:$string = "helLo";
for($i=0;$i<strlen($string);$i++){
if(ord($string[$i]) >= 65 && ord($string[$i]) <= 90){
echo $string[$i] . "= Upper case <br>";
}
else{
echo $string[$i] . "= Lower case <br>";
}
}
Bookmarks