显示代码有问题,图片不显示
<?php
$src = "001.png";
$info = getimagesize($src);
$type = image_type_to_extension($info[3], false);
$fun = "imagecreatefrom{$type}";
$image = $fun($src);
$font = "msyhl.ttc";
$content = "添加水印文字";
$color = imagecolorallocatealpha($image, 255, 255, 255, 50);
imagettftext($image, 20, 0, 20, 30, $color, $font, $content);
header("Content-type:" . $info['mime']);
$func = "image{$type}";
$func($image);
?>