0
我在排序腳本中的PNG文件時遇到問題。僅在目錄中顯示PNG文件PHP
<?php
if ($handle = opendir('../banners/')) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") { ?>
<tr>
<td><a href="../banners/<?php echo $entry; ?>" target="_blank"><img src="../banners/<?php echo $entry; ?>" /></a></td>
<td><?php echo $entry; ?></td>
<td><a href="<?php echo $adminurl; ?>banners/delete/<?php echo $entry; ?>/"><img src="<?php echo $siteurl; ?>style/images/delete.png" class="delete-icon" alt="Verwijder" /></a></td>
</tr>
<?php }
}
closedir($handle);
}
?>
這工作正常,但它也顯示index.php,PSD文件,基本上每個文件。
我怎樣才能讓它只顯示.png擴展名文件?
思想,我有我的腳本通過使用代碼的工作,但它並沒有真正現在顯示的任何文件,我怎麼能實現你的代碼? –
包含目錄。查看我更新的代碼。 –
我現在開始工作了,謝謝! –