-4

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!

3
  • 1
    please show us the code u tried. Commented Jan 14, 2016 at 4:49
  • What should I show ? It's just a random image picking from image. That's simple then why r u asking for code ? Commented Jan 14, 2016 at 5:03
  • if you can not show your code than what you want that we should code for you? Commented Jan 14, 2016 at 5:14

1 Answer 1

0

Do next steps: 1) Take some random image 2) Add this image's name to some array 3) Randomly choose one more image and, if this image is already exists in your array, choose another image randomly.

Sign up to request clarification or add additional context in comments.

6 Comments

@johnjosh you may create a static array
@johnjosh create static array, then do that 3 steps. And all images have been showed already, clean the array
How to create static array ? I'm not using OOP approach. @Khazratbek
@johnjosh in asp.net or php?
I'm using php sorry.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.