Here’s the basic code to make a list.

if($handle =opendir('.'))