Jump to content

Display files in array from end to beginning


franzwarning

Recommended Posts

Here is my current code to display files from the end to beginning :

<?php
function func() {
	$date = date("Y-m-d");
	$picarray = array();
	$userarray = array();
        $handle = opendir ('pqimages/'.$date.'/');
        while (false !==($file = readdir($handle))) {
            if($file != "." && $file != "..") {
                $picarray[] = "http://blah.com/pqimages/".$date."/".$file."";
                $userarray[]= "pqimages/".$date."/".$file."";
            }
        }
        sort($picarray);
        sort($userarray);
        closedir($handle);
	$json_array = json_encode($picarray); 
	echo $json_array;  
	}
	func();
?>

 

How could I change this from end to beginning  for ($picarray)?

 

Cheers,

George

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.