首页 > 后端开发 > php教程 > php创建可阅读随机字符串的代码

php创建可阅读随机字符串的代码

WBOY
发布: 2016-07-25 09:03:21
原创
898 人浏览过
  1. /**************
  2. *@length - length of random string (must be a multiple of 2)
  3. **************/
  4. function readable_random_string($length = 6){
  5. $conso=array("b","c","d","f","g","h","j","k","l",
  6. "m","n","p","r","s","t","v","w","x","y","z");
  7. $vocal=array("a","e","i","o","u");
  8. $password="";
  9. srand ((double)microtime()*1000000);
  10. $max = $length/2;
  11. for($i=1; $i{
  12. $password.=$conso[rand(0,19)];
  13. $password.=$vocal[rand(0,4)];
  14. }
  15. return $password;
  16. }
  17. ?>
复制代码


来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板