得到的base64 PHP字符串到img标签 [英] get base64 php string into img tag
本文介绍了得到的base64 PHP字符串到img标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
香港专业教育学院得到了PHP文件get.php呼应的一个base64字符串。
Ive got a php file 'get.php' that echo's a base64 string.
我将如何显示此作为另一个PHP页面的图像?
How would i display this as an image in another .php page?
是这样的:
<img src="get.php?id=$lastid">
感谢您的帮助!
推荐答案
您可以做这样的事情:
<img src="data:image/png;base64,BASE64STRING">
但如果你BASE64STRING是一个PHP的输出,那么像这样的工作:
but if you BASE64STRING is the output of a php, then something like this would work:
<img src="data:image/png;base64, <?php include 'get.php?id=$lastid' ?>>
我知道这可能不完全是,但我希望你的想法
I know it may not be exactly but I hope you get the idea
这篇关于得到的base64 PHP字符串到img标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文