输入banner图图片脚本导航/分类

PHP产生任意长度的字符串+数字随机数

可以自定义产生什么字符串以及多长

  1. function random($length)
  2. {
  3. $hash = '';
  4. $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
  5. $max = strlen($chars) - 1;
  6. mt_srand((double)microtime() * 1000000);
  7. for($i = 0; $i < $length; $i++)
  8. {
  9. $hash .= $chars[mt_rand(0, $max)];
  10. }
  11. return $hash;
  12. }

PHP