Jump to content

Return results into a table


Local Hero

Recommended Posts

I have a folder that has a bunch of images. Then I have a script to view the images of that folder, it puts the images one by one on top of each other along with details about the image. I'd like to put the images into tables and have 2 or 3 images per row. I'm not sure how to do that?

 

 
$search = $num;  //$num is the search for image with a specific number
 $dir = "savedImage/";
$files = scandir($dir);
foreach($files as $$key=>$value)
{
if(stripos($value, $search) !== false)
{
	 $array_of_images[] = $value;
}
}


{
 foreach($array_of_images as $value)
	 {
  echo "<a href='savedImage/".$value."' target='blank'>". $value ."'<br><img src=./savedImage/" . $value . " width=300></a><br><br>"; 

    }
}

Link to comment
https://forums.phpfreaks.com/topic/274704-return-results-into-a-table/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.