Using this function, I read the data about the files.

$d = "../files"; $dh = opendir( $d ) or die ( "Не удалось открыть каталог $d" ); while ( $f = readdir( $dh ) ) { if(($f != '.') && ($f != '..')) { $f = strtolower($f); $size = round(filesize($f)/1024); $lastcng = date("dmY", filectime($f)); } } closedir($d); 

The file with the code is located in the files folder. She reads it normally. However, if you write another folder, higher or lower, then only the names are displayed, and the size goes 0, and the creation date is somehow incomprehensible.

What could be the problem? Rights seem to be fine.

    1 answer 1

    it is written, rewritten and everything is from laziness, go to php.net , there are a lot of examples of how to bypass directories. $f contains the name of the file in the open directory. it does NOT contain the path to this file. want to use this name in other functions - add the DIRECTORY where it lies ...

    • Yes, I forgot the way, thank you very much! - Svyatoslav
    • And strtolower () clean. - user6550