I am making a PHP login/register form and to confirm whether someone is actually human and not a bot I am generating a random value that has to be written in a certain way. For example:
Please write the following number in an increasing manner: 34745 The user should write 34457 and only then will the confirmation work.
The thing is I know how to use the rand() function, that's how I generate the number. But the problem is I do not know how to make PHP sort the generated number's numerical values (for ex.: 64348 -> 34468). How do I do this? I hope there is a single function for that, as I've seen numerous ways to sort arrays and since they have indexes I only suppose that it should be possible to sort a number's values.