tivrfoa Posted June 10, 2009 Share Posted June 10, 2009 hello folks! $photo = "upload/4/splash.jpg"; preg_match('/.+\.(jpeg|jpg|gif)/', $photo) --> return false I want one or more of anything plus dot jpeg or jpg or gif. Help meee! =D Quote Link to comment https://forums.phpfreaks.com/topic/161621-solved-regexp-doubt-preg_matchjpegjpggif-photo/ Share on other sites More sharing options...
Maq Posted June 10, 2009 Share Posted June 10, 2009 Returns true for me... Can you show us more code? Quote Link to comment https://forums.phpfreaks.com/topic/161621-solved-regexp-doubt-preg_matchjpegjpggif-photo/#findComment-852849 Share on other sites More sharing options...
tivrfoa Posted June 10, 2009 Author Share Posted June 10, 2009 Returns true for me... Can you show us more code? thanks Maq and sorry! the regexp is (almost) correct, I forgot the "!". shame :/ if($photo == null || !preg_match('/.+\.(jpeg|jpg|gif)$/', $photo)) { now it's correct thank you again!!! Quote Link to comment https://forums.phpfreaks.com/topic/161621-solved-regexp-doubt-preg_matchjpegjpggif-photo/#findComment-852854 Share on other sites More sharing options...
Maq Posted June 10, 2009 Share Posted June 10, 2009 the regexp is (almost) correct, I forgot the "!". shame :/ YW. Wasn't really an issue with the regex, just a logical error. Please mark solved. Quote Link to comment https://forums.phpfreaks.com/topic/161621-solved-regexp-doubt-preg_matchjpegjpggif-photo/#findComment-852855 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.