PHP 接口输出 图片

html:

<img src="{eq name='v.miniqrcode' value=""}{:url('makeMiniQrcode_do')}?id={$v.id}{else/}{$v.miniqrcode}{/eq}" style="100%;">
// 接口地址写在src属性中

PHP:

header('Content-type:image/png');
echo file_get_contents(ROOT_PATH . $filepath);

1

原文地址:https://www.cnblogs.com/Skate0rDie/p/11446772.html