1、运用PHP的file_get_contents()函数
file_get_contents() 函数把全部文件读入一个字符串中。
示例:
<?php header('content-type:image/jpg;'); $content=file_get_contents('1.jpg'); echo $content; ?>
输出:
2、运用echo+img标签
运用PHP插进去图片,现实照样输出HTML代码。
示例:
<?php echo "<img src='1.jpg' />"; ?>
输出:
以上就是php中怎样显现图片?的细致内容,更多请关注ki4网别的相干文章!