$d=dir("."); echo $d->path; while(false !== ($e = $d->read())) { echo "<a href=$e target=_blank >$e</a>"."<br>"; } $d->close();