php创建具有唯一序列号的多个图像文件时出错
我有一个功能,可以创建多个图像,每个图像上都有唯一的序列号。问题在于,它会在浏览器上创建一个小正方形,而在保存回仪表板后不会重定向浏览器php创建具有唯一序列号的多个图像文件时出错,php,image,header,Php,Image,Header,我有一个功能,可以创建多个图像,每个图像上都有唯一的序列号。问题在于,它会在浏览器上创建一个小正方形,而在保存回仪表板后不会重定向浏览器 header("Content-type: image/png"); $imgPath = 'background1.png'; $string = $serialNumber; $directory = "serial_image/".$string.".png"; $image = imagecreatefrompng($imgPath); $color
header("Content-type: image/png");
$imgPath = 'background1.png';
$string = $serialNumber;
$directory = "serial_image/".$string.".png";
$image = imagecreatefrompng($imgPath);
$color = imagecolorallocate($image, 0, 0, 0);
$font = 'arial.ttf';
$fontSize = 13;
$x = 20;
$y = 212;
imagettftext($image, $fontSize, 0, $x, $y, $color, $font, $string);
imagepng($image, $directory);
我调用该函数创建10个图像,每个图像具有唯一的序列号。它们已创建,但随后浏览器停止并仅显示此正方形
我试过ob\u start()
和ob\u flush()
,但运气不好
我认为这是头球问题
有人能帮我做这个吗