Not sure if this would be anyway possible, hopefull some of you GD gurus
will have an idea.

Basically the scenario is, I have a dirtectory of images(5 to be exact).

What I want to be able to do is something similar to the script below, which
randomizes a gif image selection.  the file is called "image.php", the
person calls it like they would an image: <img src="img.php"> and boom there
ya have a nice gif image.  But what I want to be able to do is join together
a number of images, so based on certain conditions, a user could call <img
src="img.php"> and this would show maybe two/three/four images joined
together.  I can do this with one fine, but I thought there may be some sort
of GD function that would tackle this.

Thanks for any help,



 Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
 Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
 Header("Pragma: no-cache");
 Header("Content-Type: image/gif");


 $i = 0;
 $dir = opendir("img");
 while(($im = readdir($dir))) {
  if($im != ".." && $im != "."){
     $image[$i] = $im;


$tot = count($image)-1;
$n = rand(0,$tot);


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to