我必须在带有“image/jpeg”标题的文件中进行多个输出。
我要显示的第一个文件是图像,然后我的脚本执行其他处理功能,最后我想在同一周期中输出另一个图像。
请看下面的代码:
<?php
header("content-type: image/jpeg");
readfile(realpath("mypath/default.jpg")); // this output my first image directly
// many other functions
echo $myotherimage->getImageBlob(); // I want that the echo of this variable REPLACE the current outbut buffer ( the readfile )
?>
有什么办法可以做到这一点?我尝试过使用 ob_* PHP 函数,但它不起作用。