$cmd = "ls -u ./html/";
exec($cmd, $arr);
echo $arr[0];

解决方案 »

  1.   

    function getfolder($url) {
    $handle = opendir($url);
    $array=array();
    $firsttime;
    while (false !== ($file = readdir($handle))) {
    if (is_dir($url."/".$file)&&$file!='.'&&$file!='..'){ 
    array_unshift($array,$file); 
    if(empty($firsttime)){
    $firsttime = filemtime($file);
    } elseif($firsttime >filemtime($file)){
    $firsttime = filemtime($file);
    }
    }
    }
    $array['first'] = date ("Y-m-d H:i:s", $firsttime);
    return $array;

    $folder = getfolder('.');
    print_r($folder);
    数组first为最早文件夹时间.