源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

產生圖片隨機字串

  • 时间:2022-11-15 18:09 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:產生圖片隨機字串
<?php   $base = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';   $words = 5;   $rand_top = strlen($base) - 1;   $string = '';   header("Content-type: image/png");   $im = imagecreate($words*16, $words*5);   $black = imagecolorallocate($im, 90, 60, 120);   $white = imagecolorallocate($im, 255, 255, 255);   for($i=0;$i<$words;$i++){     $idx = mt_rand(0, $rand_top);     imagestring($im, 3, $i*15+2, mt_rand(0, $words*2), $base[$idx], $white);   }   imagepng($im);   imagedestroy($im);   ?>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部