圖片顯示不出來,求解!!
<?php //配置圖片路徑 $src="15.jpg"; //獲取圖片信息 $info=getimagesize($src); //print_r($info); //獲取圖片類型 $type=image_type_to_extension($info[2],false); $fun="imagecreatefrom{$type}"; $image=$fun($src); //設置字體路徑 $font="msyh.ttf"; //填寫內容 $content="不想去上課!"; //設置顏色和透明度 $color=imagecolorallocatealpha($image,255,255,255,50); //寫入文字 imagettftext($image,20,0,20,30,$color,$font,$content); //瀏覽器輸出 ob_clean(); header("Content-type:".$info['mime']); $func="image{type}"; $func($image); ?>
2015-09-10
問題處理了 圖片的問題 。換了張 搞定 代碼是對的