SF23103 Posted August 23, 2014 Share Posted August 23, 2014 Is there a way to change the statement below so that it ignores case sensitivity of the variable? for instance, the statement would be true if $category == 'Admissions', 'ADMISSIONS', 'admissions', etc. For some reason I'm having the worst time finding this via google search and know y'all will be able to help! if ($category == 'Admissions') { echo ' <a href="#">-Forms</a><br /> <a href="#">-Tuition</a><br />'; } ?> Thanks! Link to comment https://forums.phpfreaks.com/topic/290622-case-sensitivity-ifthen-statement/ Share on other sites More sharing options...
CroNiX Posted August 23, 2014 Share Posted August 23, 2014 if (strtolower($category) == 'admissions') { Convert it to lower case and check against lower case Link to comment https://forums.phpfreaks.com/topic/290622-case-sensitivity-ifthen-statement/#findComment-1488748 Share on other sites More sharing options...
requinix Posted August 23, 2014 Share Posted August 23, 2014 Or strcasecmp. Link to comment https://forums.phpfreaks.com/topic/290622-case-sensitivity-ifthen-statement/#findComment-1488757 Share on other sites More sharing options...
SF23103 Posted August 24, 2014 Author Share Posted August 24, 2014 Perfect. As long as I remember to check against lower case ;-) You saved the day again... Link to comment https://forums.phpfreaks.com/topic/290622-case-sensitivity-ifthen-statement/#findComment-1488761 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.