Better randomization

hello everyone.

i’m sam and this is my first post.
i really like the code for loading a random image using .php

but i’d love to add something to it which excludes the possibility of the same number occuring twice before all numbers have been generated. does that complicate things immensely?

thank you in advance.