adding function to code that makes images show up in alphabetical order in cms system
===

I am currently using this code to pull images dynamically to a gallery in a cms system. 

Is there anything I could put in this code to show images in alphabetical or numberic order as they are not showing up on the front end in order.

    <ul class="ad-thumb-list">
				<?php
					if ($handle = opendir('public/'.$this->slug.'/'))
					{
						while (false !== ($file = readdir($handle)))
						{
							$files[] = $file;
						}
						
						$files = array_slice($files, 2);
						
						foreach ($files as $file)
						{
							$name = explode('.', $file);
							print '<li><a href="public/'.$this->slug.'/'.$file.'"><img src="public/'.$this->slug.'/'.$file.'" title="'.$name[0].'" /></a></li>';
						}
						closedir($handle);
					}
				?>
			</ul>
			


Any suggestions would be great!! 