(PHP 4 >= 4.1.0, PHP 5, PHP 7)
disk_free_space — Returns available space on filesystem or disk partition
$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.
Returns the number of available bytes as a float
실패 시 FALSE
를 반환합니다.
Example #1 disk_free_space() example
<?php
// $df contains the number of bytes available on "/"
$df = disk_free_space("/");
// On Windows:
$df_c = disk_free_space("C:");
$df_d = disk_free_space("D:");
?>
Note: 이 함수는 원격 파일을 다루지 못합니다. 파일은 서버 파일시스템을 통해서 사용 가능해야만 합니다.