代码不懂解决方法

WBOY
Release: 2016-06-13 13:10:59
Original
818 people have browsed it

代码不懂
//将四个数字随机显示在画布上,字符的水平间距和位置都按一定波动范围随机生成
  $im = imagecreate(60,20)  
  $strx=rand(3,8);
  for($i=0;$i   $strpos=rand(1,6);
  imagestring($im,5,$strx,$strpos, substr($num,$i,1), $black);
  $strx+=rand(8,12);
  }



  上面的代码的$strx=rand(3,8);$strx+=rand(8,12);这两句不是很明白,这两句怎么将$im的60平分呢,还是这里根本不是平分,可以帮我解释一下这两句代码的意思吗?特别是$strx+=rand(8,12);这句,先谢谢了




------解决方案--------------------
$strx += rand(8,12); 是 $strx = $strx + rand(8,12); 的简写
------解决方案--------------------
精神可嘉,但缺乏灵活性

PHP code
$strx = 8;//rand(3,8) 介于 3 到 8 之间,取最大值 8
for($i=0; $i';
} <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!