I'm trying to use PHP to bring in every image from a specific directory and turn them into HTML objects by wrapping some markup around them.
Right now I am just trying to get the images on the page. In the future I would also like to bring in a text file that has the same file name as the image(slide#4.jpg and slide#4.txt).
This is what I have so far.
<?php
$dir = "includes/pages/products/*.jpg";
$images = glob( $dir );
foreach( $images as $image ):
$file = basename($image);
$file = basename($image, ".jpg");
echo "<div class='"prod-cont"'>" . "<h4>" . $file . "</h4>" . "<img src'" . $image "' />" . "</div>";
endforeach;
?>
I'm not having much luck getting this going, any help is appreciated.