b一些常用的php函数/b

fuchenglai 7 0 PDF 2020-12-22 21:12:01

1.产生随机字符串函数 <?php function random($length) { $hash = ”; $chars = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz’; $max = strlen($chars) – 1; mt_srand((double)microtime() * 1000000); for($i = 0; $i < $length; $i++) { $hash .= $chars[mt_rand(0, $max)]; } return

用户评论
请输入评论内容
评分:
暂无评论