Rumah > Artikel > pembangunan bahagian belakang > 图像因其本身有错无法显示
代码如下:
<?php ob_clean();header("Content-type:image/png");$im = @imagecreate(200, 100);@imagecolorallocate($im, 240, 150, 255);$color1 = imagecolorallocate($im, 0, 0, 0);imagestring($im, 5, 8, 10, "I like PHP", $color1);imagedestroy($im);?>
ob_clean();header("Content-type:image/png");$im = @imagecreate(200, 100);@imagecolorallocate($im, 240, 150, 255);$color1 = imagecolorallocate($im, 0, 0, 0);imagestring($im, 5, 8, 10, "I like PHP", $color1);imagepng ( $im);//少了生成图片这个语句imagedestroy($im);
ob_clean();header("Content-type:image/png");$im = @imagecreate(200, 100);@imagecolorallocate($im, 240, 150, 255);$color1 = imagecolorallocate($im, 0, 0, 0);imagestring($im, 5, 8, 10, "I like PHP", $color1);imagepng ( $im);//少了生成图片这个语句imagedestroy($im);