d
Amit DhamuSoftware Engineer
 

Load Random Image From Directory

1 minute read 00000 views
$images = glob("./imgs/*.{jpg,gif,png,JPG,PNG,GIF}", GLOB_BRACE);
$random_key = rand(0, count($images)-1);
$random_image = $images[$random_key];