PHP 人类可读随机字符串

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP 人类可读随机字符串相关的知识,希望对你有一定的参考价值。

function readable_random_string($length = 6){
    $conso=array("b","c","d","f","g","h","j","k","l",
    "m","n","p","r","s","t","v","w","x","y","z");
    $vocal=array("a","e","i","o","u");
    $password="";
    srand ((double)microtime()*1000000);
    $max = $length/2;
    for($i=1; $i<=$max; $i++)
    {
    $password.=$conso[rand(0,19)];
    $password.=$vocal[rand(0,4)];
    }
    return $password;
}

以上是关于PHP 人类可读随机字符串的主要内容,如果未能解决你的问题,请参考以下文章

在 .htaccess 中启用人类可读的 URL

php 人类可读的文件大小

PHP 人类可读文件大小

PHP 使字节化人类可读

PHP 数组中的人类可读列表

PHP 用于人类可读和PHP代码插入的数组显示实用程序