一、使用php函数
file_get_contents()函数把整个文件读入到一个字符串中
返回值
the function returns the read data或者失败返回false
<?php
header('content-type:image/jpg;');
$content = file_get_contents('1.jpg');
echo $content;
二、echo+img
<?php
echo "<img src='1.jpg' />";
file_get_contents()函数把整个文件读入到一个字符串中
返回值
the function returns the read data或者失败返回false
<?php
header('content-type:image/jpg;');
$content = file_get_contents('1.jpg');
echo $content;
<?php
echo "<img src='1.jpg' />";