Hallo,
ich hoffe auf Hilfe. Ich möchte eine Bildergalerie absteigend sortieren, bekomme mit rsort aber keine Veränderung. Was mache ich falsch?
ich hoffe auf Hilfe. Ich möchte eine Bildergalerie absteigend sortieren, bekomme mit rsort aber keine Veränderung. Was mache ich falsch?
PHP-Code:
<?php
$vdir = str_replace('_','/',$_GET['t']);
$dir = 'img/'.$vdir;
$text = '';
$fotos = array();
$d = dir($dir);
while (false !== ($f = $d->read())) {
if (strpos(strtolower($f), '.gif') || strpos(strtolower($f), '.jpg')) $fotos[] = '<a href="/'.$vdir.'/'.$f.'" class="highslide" onclick="return hs.expand(this)"><img border="0" src="/'.$dir.'/thumbnail.php?file='.$f.'"></a> ';
}
$d->close();
rsort($fotos);
foreach ($fotos as $k => $v) $text .= $v;
$output['HTEXT'] = str_replace('##galerie##', $text, $output['HTEXT']);
?>
Kommentar