Skip to content

Instantly share code, notes, and snippets.

@bussyjd
Created January 10, 2012 08:13
Show Gist options
  • Save bussyjd/1587804 to your computer and use it in GitHub Desktop.
Save bussyjd/1587804 to your computer and use it in GitHub Desktop.
PHP random image generator
<?php
error_reporting(E_ALL);
$limit=10;
$width = 120;
$height = 20;
for($x=0;$x<$limit;$x++) {
$im = @imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
$maxrnd = rand(0,10);
for($y=0;$y<$maxrnd;$y++) {
imagestring($im, 1+$y, 5+$y, 5+$y, 'StacktextBENCHMARKPOWAjd+klodio nyan', $text_color);
};
//imagejpeg($im,"image$x.jpg",100);
echo "image $x\n";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment