【发布时间】:2014-07-29 01:33:58
【问题描述】:
我找到了这个话题:convert text to image in php
我测试了 Sourabh Shankar 提供的代码。
当我将此代码粘贴到一个新的空 php 文件中并调整字体路径时,它可以完美运行!
但是当我在 header('Content-type: image/png'); 之前或之后放置一个回显时行,然后一切都失败了
谁能给我一个如何在 HTML 文件中调用此图像创建器的代码:
示例:
<span>Here comes the image</span>
<?php [call function??] ?>
<span>and here we continue with some HTML</span>
我需要创建一个php函数吗?如果需要:
我究竟要返回什么? 如果我返回这个:
imagepng($im);
然后他不会执行
imagedestroy($im);
我不知道该怎么做
【问题讨论】:
标签: php http-headers