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! Quote 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"; } Quote 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 Quote 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! Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/105574-solved-easy-question/#findComment-540808 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.