Loading...
Développement-code

PHP trier des fichiers par date

Pour trier des fichiers d’un répertoire (directory) par date en PHP :

Exemple tri de fichiers images jpeg dans le tableau $files

$files = glob('path/to/files/*.jpeg');
usort($files, function($a, $b) {
return filemtime($a) < filemtime($b); });

Cet exemple fonctionne avec PHP 5.3

Pour des versions inférieures :


usort($files, create_function('$a,$b', 'return filemtime($a)

150 comments
  1. Toncolo

    cialis prescription In addition, lesinurad, probenecid, and benzbromarone were compared in vitro for effects on urate transporters and the organic anion transporters OAT 1 and OAT3, changes in mitochondrial membrane potential, and human peroxisome proliferator activated receptor gamma PPARОі activity

  2. ????????

    A fascinating conversation deserves comment. I assume that you need to write a lot more on this subject, it may not be a taboo subject but normally people are not enough to talk on such subjects. To the next. Thanks

  3. Henrietta Whelan

    Just a second to enjoy yourself with a great sport in your personal comfy house, and hopefully some winnings as well! Poker guidelines may seem quite confusing for novices. Second technique is associated to the game position.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée.