Hi ginerjim, as I previously posted I have it working, with help from the link provided by requinix, then Berand popped back with his RTFM which I initially thought was an abbreviation for something useful that I would find on that page. I copied his code and tried to implement it into what I had, assuming it would negate the need to strip out the dots, but ended up with Undefined variable warning.
It might have ultimately been for a more elegant solution Barand suggested, but as I had working anyway, I figured a partial solution with no explanation was not at this time necessary.
This is what I was trying, but as you can no doubt tell I'm getting muddled
<?php
$dir = "pics/";
$file ="";
// Open a directory, and read its contents
if (is_file($dir.$file)) {
if ($dh = opendir($dir)){
while (($file = readdir($dh)) !== false){
echo "<img src=\"$dir$file\" width=\"120px\" height=\"120px\"/>";
}
closedir($dh);
}
}
?>
I have tried various combinations etc
So attempting to defile $file, but not quite sure as to why