How to get the modified time and size of any file using PHP?

How to get the modified time and size of any file using PHP?

+3
source share
4 answers

From php.net http://us.php.net/manual/en/function.stat.php

stat

(PHP 4, PHP 5)

stat - provides file information

+5
source

SplFileInfo provides a high-level API for the file system:

$file = new SplFileInfo('path/to/file');
echo $file->getMTime();
echo $file->getSize();
+8
source

you can use this

echo date("m/d/Y",filemtime("latestime.php")); 
+4
source

You can use the filemtimeand functions for this filesize.

More here

+2
source

Source: https://habr.com/ru/post/1744131/


All Articles