Is there a way to get a random number from the list of numbers and then put them in order?
For example, if I want 4 numbers between 1 and 12, how can I get these numbers in ascending order?
EDIT: I need to be unique number.
Store random values in an array and then use the PHP sort function:
$ numbers = range (1, 12); Shuffle ($ number); $ Number = array_slice ($ numbers, 0, 4); Type ($ number);
Comments
Post a Comment