UnknownPlayer Posted June 5, 2010 Share Posted June 5, 2010 When i wonna test: $text1 = "This"; $text2 = "This"; if ($text1 == $text2) - true it works when text is same, but when i wonna test this one: $text1 = "This"; $text2 = "this"; if ($text1 == $text2) - false it is true but "T" char is first var i upper, but in second var "t" is lower, how can i get that both are true, i mean how can i test this string, but with upper and lower? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted June 5, 2010 Share Posted June 5, 2010 You could use strcasecmp or you could do <?php $text1 = "This"; $text2 = "this"; if (strtolower($text1) == strtolower($text2)) ?> Ken Quote Link to comment Share on other sites More sharing options...
UnknownPlayer Posted June 5, 2010 Author Share Posted June 5, 2010 This will work when i get some string values from mysql and put in this function ? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted June 5, 2010 Share Posted June 5, 2010 Yes, it should. String values are string values, no matter how they are obtained. Ken Quote Link to comment Share on other sites More sharing options...
UnknownPlayer Posted June 5, 2010 Author Share Posted June 5, 2010 Thanks xD Quote Link to comment 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.