View Single Post
Old 11-04-2017, 10:40 PM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
This worked nicely for me
rand_img.php

PHP Code:
function RandImg($dir) {
         
$images glob($dir '*.{jpg,jpeg,png,gif}'GLOB_BRACE);
            
$randomImage $images[array_rand($images)];

            return 
$randomImage;
                }

$ads1_image RandImg('../dir/path/toimages/'); 
use

echo "$ads1_image";
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote