Lodius2000 Posted August 1, 2008 Share Posted August 1, 2008 hi, i need a case insensitive way to compare some postdata to an array to check for matches, in_array is case sensitive basically i want to make sure Hello, HeLlO and hello are interpreted to be the same thing Link to comment https://forums.phpfreaks.com/topic/117663-solved-need-a-case-insensitive-way-to-compare/ Share on other sites More sharing options...
DarkWater Posted August 1, 2008 Share Posted August 1, 2008 Uhh: if (in_array(strtolower($_POST['someval']), array_map($array, 'strtolower'))) { } Link to comment https://forums.phpfreaks.com/topic/117663-solved-need-a-case-insensitive-way-to-compare/#findComment-605203 Share on other sites More sharing options...
Lodius2000 Posted August 1, 2008 Author Share Posted August 1, 2008 ahhhhh sweet didnt know of strtolower Link to comment https://forums.phpfreaks.com/topic/117663-solved-need-a-case-insensitive-way-to-compare/#findComment-605206 Share on other sites More sharing options...
DarkWater Posted August 1, 2008 Share Posted August 1, 2008 Any time. =P Please mark this topic as solved. Link to comment https://forums.phpfreaks.com/topic/117663-solved-need-a-case-insensitive-way-to-compare/#findComment-605208 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.