- scandir: documentation ( source)
<?PHP
$path = $_SERVER['DOCUMENT_ROOT'];
$dir = ".";
echo '<table width="80%" border="1">
<tr>
<td align="right">Path :</td>
<td><a href="'.$path.'">Parent directory</a></td>
<td>3</td>
</tr>';
// Sort in ascending order - this is default
$a = scandir($dir);
foreach($a as $key => $value)
{
echo' <tr>
<td>'.$value.'</td>
<td> </td>
<td> </td>
</tr>';
}
echo '</table>';
?>