4 entry daha
  • aşağıdaki php kodunu çalıştırabilirseniz hem random hem de dijital bir görsel almanız mümkün.
    ben anlamam bu işlerden diyorsanız da aşağıdaki kodu http://phptester.net/ e yazıp click to test your php code butonuna basmanız durumunda güzel bir görsel alabilirsiniz.
    <?php

    $image = imagecreatetruecolor(800, 800);

    $bg = imagecolorallocate($image, rand(0,55), rand(0,55), rand(0,55));

    imagefill($image, 0, 0, $bg);

    $col = imagecolorallocate($image, 255, 255, 255);

    for($i=1;$i<=20;$i++)
    {
    $col = imagecolorallocate($image, rand(0,255), rand(0,255), rand(0,255));

    $x1=rand(20,780);
    $y1=rand(20,780);
    $x2=($x1+rand(0,300))%780;
    if($x2<20)
    {
    $x2+=20;
    }
    $y2=($x2+rand(0,300))%780;
    if($y2<20)
    {
    $y2+=20;
    }
    imagerectangle($image, $x1,$y1,$x2,$y2, $col);
    }

    header("content-type: image/png");
    $image=imagerotate($image,rand(0,360),$bg);

    imagepng($image);
    ?>
11 entry daha
hesabın var mı? giriş yap