Q:

get images from directory and ad to ul

I'm using a responsive pattern from Brad Frost's library to create an image grid (beta version here: http://yogeshsimpson.com/fry). I want to have three folders of images for the three portfolio categories that my client can just drop images into. 
From there I think php is the right tool to get all the images from a folder, wrap in li and a tags and have them added to the ul. So on the homepage you see images from all three directories, and on the "lighting" page for example, you see only images from that directory, etc. 
Again I'm assuming this is fairly easy to do with php, but it's a bit beyond my grasp. Any help would be appreciated. Much thanks.

A:

Something like this will work, run it from within the folder you wish to list the files.
<?php

if ($handle = opendir('.')) {
   while (false !== ($file = readdir($handle)))
      {
          if ($file != "." && $file != "..")
      {

            $thelist .= '<li><a href="'.$file.'">'.$file.'</a>' . "<br>";

          }
       }
  closedir($handle);
  }       
?>
<P>List of files:</p>
<P><?=$thelist?></p>

Or:
<?php

// if running from your root and wish to list files from 'images' sub-folder
// use $dir = 'images';
$dir = '.'; // The directory containing the files.

// *.* will list all files. You can use *.jpg to list just JPG files, etc.
$ext = '*.*'; // will list ALL files
?> 

<ul> <?php foreach (glob($dir . '/*' . $ext) as $file) { ?> 
<li><a href="<?php echo $dir . "/" . $file ?>"><?php echo basename($file); ?></a></li>

<?php } ?> </ul>

