I have one directory called images/tips.
Now in that directory I have many images which can change.
I want the PHP script to read the directory, to find the
Load folder with images:
$folder = opendir(images/tips/);
Build table out of files/images from directory:
$i = 0;
while(false !=($file = readdir($folder))){
if($file != "." && $file != ".."){
$images[$i]= $file;
$i++;
}
}
Pick random:
$random_img=rand(0,count($images)-1);
Show on page:
echo '
';
Hope it helps. Of course enclose it in .