2017-10-05 33 views

回答

0

你試試:

<?php 

// query to database mabye? 
$myPath = getImagePath($_GET['id']); 

// what kind of image file is that? 
$contentType = getContentType($myPath); 

// read file content 
$img = file_get_contents($myPath); 

// here you tell the browser what kind of image is that e.g. jpeg,png,gif... 
header("Content-Type: $contentType"); 

echo $img; 

?> 

你需要根據自己的需要來定義getImagePath和功能的getContentType。

相關問題