Home > Backend Development > PHP Tutorial > How to solve the problem of repeated random number combinations?

How to solve the problem of repeated random number combinations?

WBOY
Release: 2016-09-09 08:28:01
Original
1941 people have browsed it

Writing like this can generate the same combination. Is there any way to prevent this duplication
How to solve the problem of repeated random number combinations?

Reply content:

Writing like this can generate the same combination. Is there any way to prevent this duplication
How to solve the problem of repeated random number combinations?

As far as this code is concerned, it will definitely produce the same combination. If you can only combine a string among these numbers, it will be repeated sooner or later. If the generated string is to be stored in the database, you can first query the generated characters in the database and regenerate them if there are any. I don’t know the specific circumstances under which you use it. Anyway, there must be a solution. Why don’t you express your needs in detail so that others can give you some ideas.

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template