$myDirectory = opendir(".");

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>navigating with opendir and readdir</title>
</head>

<body text="#FFFF00" bgcolor="#000080">
nav_dir_c.php
<table border="1">
<tr>
<th>Filename</th>
<th>Size</th>
</tr>
<?php
// open directory
$myDirectory = opendir(".");

// get each entry
while($entryName = readdir($myDirectory))
{
print("<tr>");
print("<td>$entryName</td>");
print("<td align=\"right\">");
print(filesize($entryName));
print("</td>");
print("</tr>\n");
}

// close directory
closedir($myDirectory);
?>
</table>
</body>

</html>