Code: Select all
<?PHP
$str = str_shuffle('abcdefghijklmnopqrstuvwxyz0123456789');
$substr = substr($str, 0, 6);
$im = imagecreate(60, 25);
// white background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 0);
// write the string at the top left
imagestring($im, 9, 2, 4, $substr, $textcolor);
// output the image
header("Content-type: image/png");
imagepng($im);
?>
~pickle | Changed your code tags to php rather than text