為什么瀏覽器顯示是一片亂碼
<?php
??
?$src = "t3.jpg";
?$info = getimagesize($src);
?echo "<pre>";
?$type = image_type_to_extension($info[2],false);
?$fun = "imagecreatefrom{$type}";
?$img = $fun($src);
?$font = "msyh.ttc";
?$content = "秦時明月";
?$color = imagecolorallocate($img,255,255,255);
?imagettftext($img,20,0,645,50,$color,$font,$content);
?header("content-type:image/jpg");
?$func = "image{$type}";
?$func($img);
?$func($img,'newimage',$type);
?imagedestroy($img);
?>
2016-11-06
header("content-type:", $info['mime']);
?$func($img,'newimage.'.$type);
你這兩句不知道是打錯了,還是寫錯了,你的打開是亂碼,有沒有報錯信息,還有看看你保存php文件的編碼是不是utf-8無bom格式的