otuatail Posted July 20, 2012 Share Posted July 20, 2012 Hi I want to check strings including case sensitive but I cant get it to work $Name = strtolower (trim(stripslashes($_POST['Name']))); $Pwd1 = strtolower (trim(stripslashes($_POST['PWD1']))); if($Name == "Abc" && $Pwd1 == "Xyz") { // } thi if statment works for Abc abc ABC Need it to be case sensitive Any ideas please Desmond. Link to comment https://forums.phpfreaks.com/topic/266004-case-sensitve-if-statment/ Share on other sites More sharing options...
xyph Posted July 20, 2012 Share Posted July 20, 2012 You need to remove the strtolower call. It's converting all of your letters in those variables to lower-case. PHP will naturally perform case-sensitive comparisons. Link to comment https://forums.phpfreaks.com/topic/266004-case-sensitve-if-statment/#findComment-1363057 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.