|
Generate Dynamic Index Files in PHP |
|
|
|
Tutorials / FAQs -
Programming
|
|
Page 2 of 2 This sample script shows you how to output the directory information with properly formatted html links to everything. Output the directory info with links <div style="margin-left: 30px; margin-top: 10px;"> DIRECTORIES: <ul> <?php foreach ($aDirArr as $dirPtr) { echo "<li><a href='". rawurlencode($dirPtr['filename']). "'>". $dirPtr['filename']. "</a></li>"; } ?> </ul> </div> <div style="margin-left: 30px; margin-top: 30px;"> FILES: <ul> <?php foreach ($aFileArr as $filePtr) { echo "<li><a href='". rawurlencode($filePtr['filename']). "'>". $filePtr['filename']. "</a>"; if(strlen($filePtr['filesize'])) { echo "<span style='margin-left: 20px;'>". $filePtr['filesize']. "</span>"; } } ?> </ul> </div>
|