小编mgv*_*513的帖子

使用readfile和file_get_contents损坏的映像

我正在尝试使用一个函数来实现这个功能:

<img src='login.php?image=ind_legend.jpg'>
Run Code Online (Sandbox Code Playgroud)

但我不能通过功能来放置图像.我回过头几步,只尝试了这部分代码:

<?php
$file = "http://localhost/sales/test.jpg";
header('Content-type: image/jpeg');
readfile($file);
?>
Run Code Online (Sandbox Code Playgroud)

或使用此功能:

echo file_get_contents($source);
Run Code Online (Sandbox Code Playgroud)

但事实是,我唯一得到的是一个破碎的图像交叉(IE)或在Firefox中没有.

我将不胜感激任何建议

提前致谢

php image file-get-contents readfile

5
推荐指数
2
解决办法
6962
查看次数

标签 统计

file-get-contents ×1

image ×1

php ×1

readfile ×1