PHP rand function (or not so rand)
- by Badr Hari
I was testing PHP rand function to write on a image. Of course the output shows that it's not so random. The code I used:
<?php
header('Content-Type: image/png');
$lenght = 512;
$im = imagecreatetruecolor($lenght, $lenght);
$blue = imagecolorallocate($im, 0, 255, 255);
for ($y = 0; $y < $lenght; $y++) {
for ($x = 0; $x < $lenght;…