您的位置:首页 > 编程语言 > PHP开发

生成随机字符串

2008-11-29 10:54 295 查看
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-4490194096475053";
/* 内容页,300x250,第一屏 */
google_ad_slot = "3685991503";
google_ad_width = 300;
google_ad_height = 250;
//-->
</SCRIPT>

<SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript>
</SCRIPT>

<SCRIPT>window.google_render_ad();</SCRIPT>
<IFRAME id=google_ads_frame2 style="LEFT: 0px; POSITION: absolute; TOP: 0px" name=google_ads_frame marginWidth=0 marginHeight=0 src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-4490194096475053&dt=1227927245984&lmt=1226285585&prev_slotnames=1891601125&output=html&slotname=3685991503&correlator=1227927245953&url=http%3A%2F%2Fwww.corange.cn%2Farchives%2F2008%2F09%2F1669.html&eid=30143018&ea=0&ref=http%3A%2F%2Fwww.corange.cn%2Fhtml%2Fcorange__91.html&frm=0&ga_vid=2091876339.1227189135&ga_sid=1227927067&ga_hid=917430264&ga_fc=true&flash=9.0.124.0&u_h=768&u_w=1024&u_ah=738&u_aw=1024&u_cd=32&u_tz=480&u_java=true&dtd=31&w=300&h=250&xpc=L2bMZzir1t&p=http%3A//www.corange.cn" frameBorder=0 width=300 scrolling=no height=250 allowTransparency></IFRAME>function genRandomString($len)
{
$chars = 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", "", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" );
$charsLen = count($chars) - 1;
shuffle($chars);
$output = "";
for ($i=0; $i<$len; $i++) {
$output .= $chars[mt_rand(0, $charsLen)]; }
return $output;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  output function c