Warning: file_put_contents(): Only -1 of 152 bytes written, possibly out of free disk space in /var/www/html/index.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 25
dirname disk_total_space Filesystem PHP Manual disk_free_space (PHP 4 >= 4.0.7, 5) — Returns available space in directory 說明 float ( string $directory ) Given a containing directory, this ...
Forum und email

disk_free_space

(PHP 4 >= 4.0.7, PHP 5)

disk_free_space — Returns available space in directory

說明

float disk_free_space ( string $directory )

Given a string containing a directory, this function will return the number of bytes available on the corresponding filesystem or disk partition.

參數

directory

A directory of the filesystem or disk partition.

Note: Given a file name instead of a directory, the behaviour of the function is unspecified and may differ between operating systems and PHP versions.

Return值

Returns the number of available bytes as a float.

範例

Example#1 disk_free_space() example

<?php
// $df contains the number of bytes available on "/"
$df = disk_free_space("/");

// On Windows:
disk_free_space("C:");
disk_free_space("D:");
?>

註釋

Note: 本函式不能作用於遠端檔案,被檢查的檔案必須可經由伺服器的檔案系統存取。