Domanda

here is my code:

 date_default_timezone_set('Europe/Baku');
        $dh =opendir('C:\Program Files (x86)\Zend\Apache2\htdocs\upload\extjs-4.1.1\welcome\css');
        $full_path='C:\Program Files (x86)\Zend\Apache2\htdocs\upload\extjs-4.1.1\welcome\css';
        $way=array();

        while ($file = readdir($dh)):

         array_push($way,$full_path.$file);
         endwhile;
        closedir($dh);
        echo '<br>';
        for ($t=2;$t<=6;$t++){
       echo "<br> $way[$t] : " . filetype($way[$t]) . "\nCreate Date: " . date("F d Y                       H:i:s ", filemtime((string)$way[$t]) );   

        }


echo '<br>'.date ("F d Y H:i:s.", filemtime('C:\Program Files (x86)\Zend\Apache2\htdocs\upload\extjs-4.1.1\welcome\css\blank.gif'));

        ?>

and this is what it response:

C:\Program Files (x86)\Zend\Apache2\htdocs\upload\extjs-4.1.1\welcome\cssblank.gif : Create Date: January 01 1970 00:00:00 C:\Program Files (x86)\Zend\Apache2\htdocs\upload\extjs-4.1.1\welcome\cssiepngfix.htc : Create Date: January 01 1970 00:00:00 C:\Program Files (x86)\Zend\Apache2\htdocs\upload\extjs-4.1.1\welcome\csswelcome.css : Create Date: January 01 1970 00:00:00 C:\Program Files (x86)\Zend\Apache2\htdocs\upload\extjs-4.1.1\welcome\csswelcome_ie6.css : Create Date: January 01 1970 00:00:00 : Create Date: January 01 1970 00:00:00 July 04 2012 16:13:34.

I think that filemtime cannot read modify time and don't know why. Please help me.

È stato utile?

Soluzione

-$full_path='C:\Program Files (x86)\Zend\Apache2\htdocs\upload\extjs-4.1.1\welcome\css';
+$full_path='C:\Program Files (x86)\Zend\Apache2\htdocs\upload\extjs-4.1.1\welcome\css\';

You had lost backslash in full_path variable. So, you get wrong full path to files:

'C:\Program Files (x86)\Zend\Apache2\htdocs\upload\extjs-4.1.1\welcome\csswelcome.css'

instead of

'C:\Program Files (x86)\Zend\Apache2\htdocs\upload\extjs-4.1.1\welcome\css\welcome.css'
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top