<?php// Create a 100*30 image
$im = imagecreate(100, 30);
// White background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 100, 0, 255);
// Write the string at the top left
$A=rand(99,999);
imagestring($im, 5, 37, 7,$A, $textcolor);
// Output the image
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
<img src="image.php" alt="">