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"; } ?> 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 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 ==. 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 ==. 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... Link to comment https://forums.phpfreaks.com/topic/113670-solved-make-case-sensitive/#findComment-584167 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.