php imagepng没有在服务器上创建图像,但是没有错误?

问题描述 投票:0回答:1
     $string ="this string in image";
     $img = imagecreate(250, 30);
     $white = imagecolorallocate($img, 255, 255, 255);
     $black = imagecolorallocate($img, 0, 0, 0);
     $font = "./arial.ttf"; 
     imagefilledrectangle($img, 0, 0, 250, 30, $white);
     imagettftext($img, 20, 0, 25, 10, $black, $font, $string);
     imagepng($img, "/path/to/file.png");
     imagedestroy($img);

要编辑什么?或关于为什么未创建file.png的想法?谢谢

php imagettftext
1个回答
0
投票

请确保将此属性添加到您的表单标签中。 (enctype="multipart/form-data“)

<form action="" method="" enctype="multipart/form-data">
© www.soinside.com 2019 - 2024. All rights reserved.