PHP Code By http://t.qq.com/tony-src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
    
    /**
     * 确定文件的大小  filesize()
     */

    $file = 
'C:\appserv\www\HelloPHP\index.php' ;
    
echo round(filesize($file)/1024,2).'KB'.'<br>';

    
/**
     * 计算磁盘的可用空间        disk_free_space()
     */

    $driver = 
'C:';
    
echo round(disk_free_space($driver)/1024/1024/1024,2).'GB'.'<br>';
    
    
/**
     * 计算磁盘的总容量 disk_total_space()
     */

    
echo round(disk_total_space($driver)/1024/1024/1024,2).'GB'.'<br>';
    
    
/**
     * 确定文件的最后访问时间      fileatime(),最后访问时间
     */

    date_default_timezone_set(
'Asia/Shanghai');
    
echo date('Y-m-d H:i:s',fileatime($file)).'<br>';
    
    
/**
     * 确定文件的最后改变时间      filectime() ,所有者,权限修改时间
     */

    
echo date('Y-m-d H:i:s',filectime($file)).'<br>';
    
    
/**
     * 确定文件的最后修改时间      filemtime(),文件内容修改时间
     */

    
echo date('Y-m-d H:i:s',filemtime($file).'<br>');
    
?>




相关文章:

  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2021-12-19
  • 2022-12-23
  • 2021-08-27
猜你喜欢
  • 2022-12-23
  • 2021-11-20
  • 2022-01-01
  • 2021-12-21
  • 2021-06-21
  • 2021-12-30
  • 2021-12-03
相关资源
相似解决方案