开发者

how to draw multiple png images in same page using php

can anybody help me how to draw a multiple png images in a same page u开发者_开发技巧sing image functions in php...where I can able to create a single image but not more than that....


Just use the <img> tag to link to the PHP script that generates your image

<img src="my_image_drawing_script.php?image_to_draw=1" />
<img src="my_image_drawing_script.php?image_to_draw=2" />
<img src="my_image_drawing_script.php?image_to_draw=3" />

and so on

In the PHP script itself:

switch (intval ($_GET ['image_to_draw']))
{
    case 1:
        // Logic for drawing image 1 goes here
    break;
    case 2:
        // Logic for drawing image 2 goes here
    break;
    case 3:
        // Logic for drawing image 3 goes here
    break;
    default:
        // invalid input
    break;
}

Or, you could have a PHP script for each image if you prefer.

<img src="my_image_drawing_script_1.php" />
<img src="my_image_drawing_script_2.php" />
<img src="my_image_drawing_script_3.php" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜