Discuz教程网

PHP随机字符串函数

[复制链接]
authicon dly 发表于 2011-3-28 19:08:51 | 显示全部楼层 |阅读模式
  1. function readable_random_string($length = 6){
  2. $conso=array("b","c","d","f","g","h","j","k","l",
  3. "m","n","p","r","s","t","v","w","x","y","z");
  4. $vocal=array("a","e","i","o","u");
  5. $password="";
  6. srand ((double)microtime()*1000000);
  7. $max = $length/2;
  8. for($i=1; $i<=$max; $i++)
  9. {
  10. $password.=$conso[rand(0,19)];
  11. $password.=$vocal[rand(0,4)];
  12. }
  13. return $password;
  14. }

复制代码






上一篇:php利用fopen下载保存远程文件到本地服务器的函数
下一篇:PHP识别Robot(Spider,机器人,搜索引擎)函数
authicon 乐娃娃 发表于 2011-5-11 06:59:52 | 显示全部楼层
这个不错呀
authicon lilac_yao 发表于 2011-5-13 08:59:58 | 显示全部楼层
不错,谢谢分享
authicon 月之海洋 发表于 2011-5-21 14:59:38 | 显示全部楼层
这个不错呀
authicon 咫尺天 发表于 2011-5-22 15:59:57 | 显示全部楼层
支持楼主,顶一下
authicon shakesxia 发表于 2011-5-24 16:59:51 | 显示全部楼层
这个贴不错!!!
authicon melody0721 发表于 2011-5-25 08:59:40 | 显示全部楼层
真的有意思!
authicon cutiemimi 发表于 2011-6-20 04:00:56 | 显示全部楼层
哦哦,发财了啊,看到好东西啦
authicon 21585151 发表于 2011-6-22 10:59:34 | 显示全部楼层
有意思~顶顶 ,继续顶顶。继续顶哦
authicon YY大兔子 发表于 2011-6-23 01:59:47 | 显示全部楼层
好像不错的样子
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-3 03:28

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表