Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/21/2020 in all areas

  1. Best way to traverse an array is with foreach(). $fileArr = []; $files = glob("$masterdir/*.jpg"); foreach ($files as $fname) { $t = filemtime($fname); $fileArr{$fname} = $t; } arsort($fileArr); foreach (array_slice($fileArr, 0, 7) as $thisName => $thisTime) { // iterate through first 7 files echo "$thisName &mdash; " . date("d M y", $thisTime) . '<br>'; }
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.