Northern Flame Posted July 8, 2008 Share Posted July 8, 2008 How can I make the following function return false: <?php function equalValues($one, $two){ if($one == $two){ return true; } else{ return false; } } if(equalValues("test", "TEST")){ echo "same"; } else{ echo "different"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/113670-solved-make-case-sensitive/ Share on other sites More sharing options...
kenrbnsn Posted July 8, 2008 Share Posted July 8, 2008 It already does. Ken Quote Link to comment https://forums.phpfreaks.com/topic/113670-solved-make-case-sensitive/#findComment-584150 Share on other sites More sharing options...
DarkWater Posted July 8, 2008 Share Posted July 8, 2008 I think he means like case sensitive. Use === instead of ==. Quote Link to comment https://forums.phpfreaks.com/topic/113670-solved-make-case-sensitive/#findComment-584151 Share on other sites More sharing options...
bluejay002 Posted July 8, 2008 Share Posted July 8, 2008 It actually return false, without any mods. But if what you want is to check for identicality rather than equality, use === instead ==. Quote Link to comment https://forums.phpfreaks.com/topic/113670-solved-make-case-sensitive/#findComment-584155 Share on other sites More sharing options...
The Little Guy Posted July 8, 2008 Share Posted July 8, 2008 I think preg_match() may also work... Quote Link to comment https://forums.phpfreaks.com/topic/113670-solved-make-case-sensitive/#findComment-584167 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.