I'm trying to reuse some PHP that I found on here, but I don't have much experience with PHP and became stuck.
When uploading images from a camera and I'd like to be able to display the 4 newest images as large as possible while fitting on a screen without scrolling. 2 wide, 2 high: dividing the full screen resolution into 4 quadrants. The initial PHP prints them down in a column (by adding a break after each image in the loop), and I now have them printing horizontally as well. However, they are too small to reasonably view from a distance. I'm not sure how to print two, create a line break, and then print the last two. Or if there is a way to do it with a table and have one image in each td
Here's where I am right now:
<?php
$images = glob('images/*.{jpg,jpeg}', GLOB_BRACE); //formats to look for
$num_of_files = 4; //number of images to display
foreach($images as $image)
{
$num_of_files--;
if($num_of_files > -1)
echo "<img src="."'".$image."'".">";
else
break;
}
?>
I'm using some CSS to add z-index, but this is the basic code.