dragunu Posted January 11, 2007 Share Posted January 11, 2007 Hello all :)I am doing a search system, however, i would like to make php ignore case sensitivity.can it be done?thanksdragunu Link to comment https://forums.phpfreaks.com/topic/33715-ignore-case-sensitivity/ Share on other sites More sharing options...
matto Posted January 11, 2007 Share Posted January 11, 2007 why don't you force the case using something like strtolower() when evaluating any condition[code]<?phpif(strtolower($var1) == strtolower($var2)) { //match} else { //no match}?>[/code] Link to comment https://forums.phpfreaks.com/topic/33715-ignore-case-sensitivity/#findComment-158088 Share on other sites More sharing options...
dragunu Posted January 11, 2007 Author Share Posted January 11, 2007 yes i can, i was wondering if there was a particular function tho :)thanks! Link to comment https://forums.phpfreaks.com/topic/33715-ignore-case-sensitivity/#findComment-158089 Share on other sites More sharing options...
matto Posted January 11, 2007 Share Posted January 11, 2007 You can do this with regular expressionsfor example:[code]'/(?i)[a-z]\d[a-z]/'[/code]Pattern matches a2B, A2B, a2b etc Link to comment https://forums.phpfreaks.com/topic/33715-ignore-case-sensitivity/#findComment-158094 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.