我想从放置在表格中的数据创建图像。
到目前为止,我的代码:
$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);
但是我得到了这个输出:
PNGIHDR2�E7�PLTE���EpHYs���+IDATH�1�Om����*�IEND�B`
我做错了什么?