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... Quote 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 Quote 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) ... ) Quote Link to comment https://forums.phpfreaks.com/topic/54923-capitol-letters/#findComment-271643 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.