0
donc mon code actuel:Trier des fichiers par heure Modification en PHP
$path = 'C:\\movies';
$d = dir($path);
$movies = array();
$movietimes = array();
while (false !== ($entry = $d->read()))
{
if($entry !== '.' AND $entry !== '..')
{
$stat = stat($path.'\\'.$entry);
$movietimes[] = $stat['ctime'];
$movies[] = $entry;
}
}
$d->close();
natsort($movietimes);
$movietimes = array_reverse($movietimes, true);
foreach($movietimes as $k=>$v)
{
echo $movies[$k];
}
Mais maintenant, je veux être en mesure d'accéder à trois à la fois. Des idées?
3 quoi à l'heure? – Petah
films voir la ligne: echo $ movies [$ k]; – Johnny
'array_chunk' le tableau trié et boucle sur les morceaux. – salathe