<?php
header("Content-type: image/png");
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
you get error The image “http://localhost/ip/image.php” cannot be displayed, because it contains errors.
do bạn save as file dạng utf-8
chuyển về ansi có thể chạy được( now save it as ANSI and it works as expected )
No comments: