2016-05-31 109 views
-3

我的字符串被截斷。我無法獲得原始字符串。Base64encode圖像字符串被截斷

$img_file = product6.jpg'; 
$imgData = base64_encode(file_get_contents($img_file)); 
$src = 'data:image/jpg;base64,'.$imgData; 

你能幫幫我嗎?

回答

0

你丟失了單引號

$img_file = 'product6.jpg';