I simply want to generate an array of random numbers and I also want to have no more than one instance of any numbers.
What I am thinking is having a a loop to fill in the array with random numbers and then checking the elements to see if there are any duplicates and if there are any, generating a new set.
My search led me to
array_count_values()
. It looks like I can use it and check if any of the result array elements has a value bigger than 1.
Is there a simpler way or a function for this check? (I just need to know if there are duplicates in an array or not, no removes, no replaces and such)
Thanks in advance