function getRand($length = 16){ $a = range(0,9); for($i=0; $i<$length; $i++){ $b[] = array_rand($a); } return join("", $b); }//该片段来自于http://www.codesnippet.cn/detail/3006201512971.html
来源: http://www.codesnippet.cn/detail/3006201512971.html