AV1611 Posted June 10, 2007 Share Posted June 10, 2007 can someone help me make this clause "Caps Insensitive"? if ($test == ".jpg" || $test == ".png" || $test == ".bmp" || $test == ".gif" ) I hate regex... Link to comment https://forums.phpfreaks.com/topic/54923-capitol-letters/ Share on other sites More sharing options...
AndyB Posted June 10, 2007 Share Posted June 10, 2007 $test = strtolower($test); if ..... as before ...; // although in_array() might be more elegant Link to comment https://forums.phpfreaks.com/topic/54923-capitol-letters/#findComment-271626 Share on other sites More sharing options...
AV1611 Posted June 10, 2007 Author Share Posted June 10, 2007 $test = strtolower($test); if ..... as before ...; // although in_array() might be more elegant WOW That's better/faster than what I did... I always forget about strtolower()... if (preg_match("/.png$/i", $file) || preg_match("/.jpg$/i", $file) ... ) Link to comment https://forums.phpfreaks.com/topic/54923-capitol-letters/#findComment-271643 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.