问题:
代码:
<?php
$im = imagecreate(100, 30);
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
imagestring($im, 5, 0, 0, "Hello world!", $textcolor);
header("Content-type: image/png");
imagepng($im);
?>
运行结果:
Fatal error: Call to undefined function imagecreate() in D:/wamp/www/index.php on line 2
解决方案:
把html代码(html,head,body)这些代码全部删除,就可以了。
本文介绍了一段PHP代码用于创建带有文本的简单图像,并解决了因HTML标签导致的错误问题。
556

被折叠的 条评论
为什么被折叠?



