0

I have this code to select and display all of the images in a folder:

<?php
$folder = 'sets/'.$post_year.'/'.$post_id.'/';
$filetype = '*.{jpg,jpeg,png,gif}*';
$filename = ; //Need to get the file name minus the extension
$files = glob($folder.$filetype, GLOB_BRACE);
foreach ($files as $file)
{
    echo '

            <div class="galleryCell">
                <img class="galleryPhoto" src="photos/'.$file.'" />
                <div>'.$filename.'</div>
            </div>

    ';
}
?>

How can I get just the file name to display it as $filename?

0 Answers0