I want to select four random images from a folder which contains a number of images.
What i want to display is a table (2×2) where i can display 4 random distinct images.
Can someone tell me how can i select random distinct files from a folder so that i can store their path in a variable and then can use these variables to display images randomly in the table!
Is there any particular function which can select random files from a folder or something like that?
glob()to get all files from directory.array_rand()to get random entries from an array.