Guest Posted May 8, 2008 Share Posted May 8, 2008 Hiya, I have the following piece of code and I would like it to perform a if statement, that says, if date = mon go to mon/screen and perfrom the rest of the code, but then if tue go to tue/screen and so on through all the days of the week. <?php putenv("TZ=Europe/Belfast"); $image_dir = 'screen/'; $fn = $image_dir . 'm' . date('H') . '00.jpg'; $img = (file_exists($fn))?$fn:'default_screen/default.jpg'; echo '<img src="' . $img . ' " width="384" height="161" />'; ?> I have wrote this but I would then need to do it for all the days, is there a shorter way to find out the day then pass it to the folder path. if date('D') = mon; echo $image_dir = 'mon/screen/'; Thanks, Quote Link to comment Share on other sites More sharing options...
clearstatcache Posted May 8, 2008 Share Posted May 8, 2008 $day = date('D'); $image_dir = $day.'/screen/'; Quote Link to comment 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.