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

http://www.kirupa.com/web/random_image.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.

sam.