by Devin Yang
(This article was automatically translated.)

Published - 2 years ago ( Updated - 2 years ago )

Randomly generate four yards of English

 //產生隨機碼,預設四碼,約七百次會出現碰撞
function get_random_key($length = 4)
{
$permitted_chars = '1234567890abcdefghijklmnopqrstuvwxyxABCDEFGHIJKLMNOPQRSTUVWXYX';
return substr(str_shuffle($permitted_chars), 0, $length);
}

Tags: php

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


php

Use PHP to clear HiBox's inbox via IMAP

The mailbox for receiving letters has exploded, and I don't want all the letters. Use PHP to clear the inbox. The following is the sample program I copied, with minor adjustments.

php, CentOS, phpize

Can't find phpize on older versions of CentOS, can't compile php extensions.

Can't find phpize on older versions of CentOS, can't compile php extensions. How to install phpize?

php

How to install PHP 7.1.7 in the old version of CentOS 5.11?

How to install PHP 7.1.7 on the old version of CentOS 5.11? An insfinit error occurred when compiling by myself. This article introduces my method.