图片输出:
<?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() 怎么处理呢?