help me to get files from a folder in array.
I am trying to get all jpg file name in array from a folder images.
and after that use rand to change css background Randomly.
JPG files from a folder in arry;
$images=array("image1.jpg", "image2.jpg");
then use the rand to load images randomly
echo '<style>body{background:url('.$images[array_rand($images)].')no-repeat;';
echo '<style>body{background:url('.array_rand(glob("images/*.jpg")).')no-repeat;';