Herzlich willkommen im Archiv vom ABAKUS Online Marketing Forum
Du befindest Dich im Archiv vom ABAKUS Online Marketing Forum. Hier kannst Du Dich für das Forum mit den aktuellen Beiträgen registrieren.
Code: Alles auswählen
<?
$handle=opendir('./bilder/gallerie/');
while ($file = readdir ($handle)) {
if ($file != "." && $file != "..") {
echo $file;
}
}
closedir($handle);
?>
Code: Alles auswählen
<?php
if ($handle = opendir('../pdfs/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "<li><a href=\"".$file."\" >" .$file. "</a></li>\n";
}
}
closedir($handle);
}
?>
Ich habe doch noch eine Frage. Er zeigt alle Dateien von alt nach neu an, also von zuerst hochgeladenen bis zuletzt hochgeladenen an. Wie kann ich die PDFs aber genau andersrum anzeigen?MrTunes hat geschrieben:Code: Alles auswählen
<?php if ($handle = opendir('../pdfs/')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "<li><a href="".$file."" >" .$file. "</a></li>\n"; } } closedir($handle); } ?>
[offtopic] Oh mein Gott, bei solchen IFrames muss ich weinen [/offtopic]workershop hat geschrieben:www.walendy-walther.de/index.php?m=2&s=0
Code: Alles auswählen
$months = array('januar' => '01', 'februar' => '02', 'märz' => '03', usw.);
$pdfs = array();
foreach (glob('ordner/*.pdf') as $pdf) {
$parts = explode('_', $pdf);
$pdfs[$pdf] = basename($parts[2]) . '-' . $month[strtolower($parts[1])];
}
rsort($pdfs);
print_r($pdfs);