我需要创建一个返回JPEG图像的php文件。我写了这段代码,但是没有用:
<?php
header('Content-type: image/jpeg;');
$p = 'http://....file.jpeg';
$a = file_get_contents('$p');
echo $a;
?>
怎么了?我认为这太简单了
您可以简单地使用<img>
标签。
<?php
$src = 'file.jpeg';
?>
<img src='<?php echo $src ?>'>
如果这不是您要查找的功能,请查看如何使用file_get_contents显示图像。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句