0

我想从放置在表格中的数据创建图像。

到目前为止我的代码:

$out = "<table><tr><td>There will be data</td></tr></table>";
header('Content-type: image/png');
$png_image = imagecreate(50, 500);
$tcol = imagecolorallocate($png_image, 255, 255, 0);
imagestring($png_image, 4, 30, 25, $out, $tcol);
//echo $out;
imagepng($png_image);
imagedestroy($png_image);

但我得到了这个作为输出:

�PNG IHDR2�E7�PLTE���E pHYs���+IDATH���1�Om����*�IEND�B`�</p>

我做错了什么?

4

1 回答 1

-1

您的代码运行良好。我得到了这个作为输出:

输出

于 2018-08-12T19:33:59.367 回答