Display a different image for each day of the month - Php

Everyday change imag

Snippet Code


  
Rate this page :
  [ 0 votes]

This PHP script will get the day of the month from the server date and then display an image (jpg or gif) to match.

<?php $image_folder = "images/"; $today = date('d'); if (file_exists($image_folder."/".$today.".jpg")) { echo "<center> <img src="$image_folder/".$today.".jpg"></center>"; } else { echo "No image was found for $today"; } /* First to collect images */ ?>

Tags


Ask Questions

Ask Question