图片输出:
<?php
$im = imagecreate(...);
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
?>
文字输出:
<?php
header("Content-type: text/html");
$string = "xxxxxx" ;
echo(nl2br(sprintf("%s\n" , $string)));
?> 但是如何实现,文字也输出,图片也能输出, header() 怎么处理呢?
<?php
$im = imagecreate(...);
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
?>
文字输出:
<?php
header("Content-type: text/html");
$string = "xxxxxx" ;
echo(nl2br(sprintf("%s\n" , $string)));
?> 但是如何实现,文字也输出,图片也能输出, header() 怎么处理呢?
比如:我用php画图,然后在后面追加文字来说明画图的意义
或者有什么变通的方式来解决?
我初学Php, 还请高手解答
文字和图片混合显示是浏览器的工作,因为 HTML 有相应的标签