简体   繁体   中英

PHP: show random images from folder without repeat

I have approximately 20-25 images in my folder.

I have PHP script, that choose and show random image. But problem is that some images have been showed repeatedly, while some others have not been showed even once.

How to display all images in a randomly choice manner?

Thanks!

执行后续步骤: 1) 获取一些随机图像 2) 将此图像的名称添加到某个数组 3) 随机再选择一张图像,如果该图像已存在于您的数组中,则随机选择另一张图像。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM