<% dim ModuleName,InfoID,ChannelShortName,CorrelativeArticle,InstallDir,ChannelDir,Keyword,PageTitle,ArticleIntro,Articlecontent Keyword=stripHTML("开发,工程师") PageTitle=stripHTML("php生成一个可选位数的随机码") ArticleIntro=stripHTML("php生成一个可选位数的随机码,<?phpechocoding(6);functioncoding($num){$str_arr=array(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o") Articlecontent=stripHTML("<?phpecho coding(6);function coding($num){$str_arr = array(a,b,c,d,e,f,g,h,i,j,k…") ModuleName = stripHTML("programme") InfoID = stripHTML("219694") ChannelShortName=stripHTML("编程") InstallDir=stripHTML("http://www.77169.com/") ChannelDir=stripHTML("programme") %> php生成一个可选位数的随机码 - 华盟网 - http://www.77169.com
您现在的位置: 华盟网 >> 编程 >> PHP编程 >> 正文

php生成一个可选位数的随机码

2015/12/7 作者:不祥 来源: 互联网
导读 <% if len(ArticleIntro)<3 then Response.Write Articlecontent 'Response.Write "Articlecontent" else Response.Write ArticleIntro 'Response.Write "ArticleIntro" end if %>

<?php
echo coding(6);
function coding($num){
$str_arr = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9');
$rand_s = array_rand($str_arr,$num);
$code_s = '';
if(is_array($rand_s)){
foreach($rand_s as $v){
$code_s .= $str_arr[$v];
}
return $code_s;
}else{
return $str_arr['rand_s'];
}
}
?>


  • 上一篇编程:

  • 下一篇编程: 没有了