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

My assembled car LaNativeRoute

Although I like Laravel very much, Laravel has many great features, such as Eloquent ORM, Model, and Blade temple, which I like very much. But seriously, he's really fat, and it's kind of slow to start, so I'm just trying to do it the way I want Extract the functions I want, and assemble this self-made frame micro-frame, which is close to Plain PHP. I think anyone who understands PHP can get started.

php

Apache removed the Authorization Header issue

Apache removed the Authorization Header, no solution can be seen in $_SERVER.

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?