如何将多个图像传递给jQuery Ajax响应

时间:2015-10-05 18:32:08

标签: php ajax

请您看一下这个演示,让我知道如何使用jquery ajax将4个生成的图像发送到客户端?

如你所见,我有一个

<?php
$a = "A";
$b = "B";
$c = "C";
$n = "8";

$ima = imagecreate(100, 30);
$bg = imagecolorallocate($ima, 255, 255, 255);
$textcolor = imagecolorallocate($ima, 0, 0, 255);
imagestring($ima, 5, 0, 0, '$a, $textcolor);
header('Content-type: image/png');
imagepng($ima);
imagedestroy($ima);

$imb = imagecreate(100, 30);
$bg = imagecolorallocate($imb, 255, 255, 255);
$textcolor = imagecolorallocate($imb, 0, 0, 255);
imagestring($imb, 5, 0, 0, '$a, $textcolor);
header('Content-type: image/png');
imagepng($imb);
imagedestroy($imb);

$imc = imagecreate(100, 30);
$bg = imagecolorallocate($imc, 255, 255, 255);
$textcolor = imagecolorallocate($ima, 0, 0, 255);
imagestring($imc, 5, 0, 0, '$a, $textcolor);
header('Content-type: image/png');
imagepng($imc);
imagedestroy($imc);

$imn = imagecreate(100, 30);
$bg = imagecolorallocate($imn, 255, 255, 255);
$textcolor = imagecolorallocate($ima, 0, 0, 255);
imagestring($imn, 5, 0, 0, '$a, $textcolor);
header('Content-type: image/png');
imagepng($imn);
imagedestroy($imn);
?>

0 个答案:

没有答案