What is the easiest and best way to create a list of random numbers from 1 to n where there are no duplicates?

I do not want to use javascript just php and cannot find any item here that best describes how to do this.

Thanks
E