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 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? 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 Quote 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!!! 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 Quote 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. 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
Archived
This topic is now archived and is closed to further replies.