Skip to content

Instantly share code, notes, and snippets.

@Borodin
Last active December 27, 2015 06:19
Show Gist options
  • Select an option

  • Save Borodin/7280789 to your computer and use it in GitHub Desktop.

Select an option

Save Borodin/7280789 to your computer and use it in GitHub Desktop.
<?
header('Content-Type: image/jpeg');
$im = imagecreatetruecolor(175, 60);
imagefill($im, 0, 0, imagecolorallocate($im, 240, 240, 240));
for($i=0; $i<5; $i++)imagettftext($im, 16, 0, 10+30*$i, 40, imagecolorallocate($im, 100, 100, 100), 'arial.ttf', rand(0, 9));
imagepng($im);
imagedestroy($im);
//imagecreatetruecolor(width, height)
//imagefill(image, x, y, color);
//imagettftext(image, size, rotation, x, y, color, fontPath, char);
//imagecolorallocate(image, r, g, b)
//imagepng(image);
//imagedestroy(image);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment