<?php $img_file = 'test.png'; // $fp = fopen($img_file, 'rb'); // $content = fread($fp, filesize($img_file)); //二进制数据 // fclose($fp); // header('Content-Type: image/jpeg'); $content=file_get_contents($img_file); //二进制的流 header('Content-Type: image/jpeg'); echo $content; ?>