how come?
this works (counts the files in the dir correctly):
$result = count($files[0]);
echo $result;
and this works (gets the LAST (newest) file in the dir correctly):
$finalone = end($files[0]);
echo $finalone;
but this returns the single word “array”
$nfive = -5;
$lastfive = array_slice($files[0], $nfive);
echo $lastfive;
What I really want to do is pull the LAST 5 (last NEWEST) files from that dir.
Dennis
This portion of the code:
Should be like this; note the
print_r:You have split one array into another array. So the
echobehavior you explained is expected.