怎么我的輸出的都是亂碼??
怎么回事啊?? 求大神支招
<?php //open?img $src?=?'images/newoffice.jpg'; $info?=?getimagesize($src); //echo?'<br?/>'; //print_r($info); $type?=?image_type_to_extension($info[2],false); //print_r($type); $func?=?"imagecreatefrom{$type}"; $image?=?$func($src); //operate?img $font?=?'data/fonts/TrajanPro3-Regular.otf'; $content?=?'New?Office?XINTIANDI,Welcome!'; $color?=?imagecolorallocatealpha($image,255,255,255,50); imagettftext($image,20,0,20,100,$color,$font,$content); //output?img ???//1.瀏覽器輸出 ???header("Content-type",$info['mime']); ???$func?=?"image{$type}"; ???$func($image); ???//2.保存輸出 ???$func($image,'newpic',$type); //distroy?img ???imagedestroy($image); ?>
2015-02-17
?同學(xué)請注意看第18行:header("Content-type",$info['mime']);
正確的答應(yīng)應(yīng)該是:?? header("Content-type: " . $info['mime']);