Schlo_50 Posted May 14, 2008 Share Posted May 14, 2008 Hello guys, I have a bit of a noobie question to ask. For the code below, how in my if statement would I try to see if $fext matches $jpg or $jpeg? At the moment it only checks to see if $fext equals $jpg. $fn = $aname; $fext = substr($aname, strrpos($aname, '.')); $jpg = ".jpg"; $jpeg = ".jpeg"; if ($fext == $jpg) { print "foo"; } Thanks guys! Link to comment https://forums.phpfreaks.com/topic/105574-solved-easy-question/ Share on other sites More sharing options...
conker87 Posted May 14, 2008 Share Posted May 14, 2008 $fn = $aname; $fext = substr($aname, strrpos($aname, '.')); $jpg = ".jpg"; $jpeg = ".jpeg"; if ($fext == $jpg || $fext == $jpeg) { print "foo"; } Link to comment https://forums.phpfreaks.com/topic/105574-solved-easy-question/#findComment-540801 Share on other sites More sharing options...
MadTechie Posted May 14, 2008 Share Posted May 14, 2008 $fn = $aname; $fext = substr($aname, strrpos($aname, '.')); $jpg = ".jpg"; $jpeg = ".jpeg"; if ($fext == $jpg || $fext == $jpeg ) { // || = or print "foo"; } EDIT: lol : conker87 beat me Link to comment https://forums.phpfreaks.com/topic/105574-solved-easy-question/#findComment-540802 Share on other sites More sharing options...
Schlo_50 Posted May 14, 2008 Author Share Posted May 14, 2008 lol Cheers guys! I know it's something silly, but it's very helpful! Link to comment https://forums.phpfreaks.com/topic/105574-solved-easy-question/#findComment-540805 Share on other sites More sharing options...
conker87 Posted May 14, 2008 Share Posted May 14, 2008 Haha. 16 seconds too late Link to comment https://forums.phpfreaks.com/topic/105574-solved-easy-question/#findComment-540808 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.