Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Sortowanie wg daty, co zrobic zeby zdjecia był sortowane wg daty?
AdiosAmigos
post
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 1.05.2009

Ostrzeżenie: (0%)
-----


Witam, co zrobic zeby zdjecia był sortowane wg daty dodania (od najnowszej)
daje kod:

CODE


$dir = 'thumbs';
$imagesExtensions = array('jpg', 'jpeg', 'gif', 'png', 'bmp');
$files = scandir($dir);
foreach($files AS $file) {
$fileinfo = pathinfo($file);
if(is_file($dir.'/'.$file) AND in_array($fileinfo['extension'], $imagesExtensions)) {
echo '<img src="'.$dir.'/'.$file.'" alt="" />';
}
}

Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 1.10.2025 - 07:29