I am trying to display random images from a directory, but glob
keeps giving me this error:
Undefined offset: 0
Which leads me to believe that it is not matching the .png
files. However shouldn't it match all files in the directory? Thanks
Code:
$banners = glob("/lib/theme/ivao/images/banners/*");
$img1 = $banners[rand(0,count($banners)-1)];