disk_free_space

(PHP 4 >= 4.1.0, PHP 5)

disk_free_space -- 返回目錄中的可用空間

說明

float disk_free_space ( string directory )

給出一個包括有一個目錄的字串,本函數將根據相應的檔案系統或磁碟分區返回可用的位元組數。

例子 1. disk_free_space() 例子

<?php
// $df 包括根目錄下可用的位元組數
$df disk_free_space("/");
//在 Windows 下:
disk_free_space("C:");
disk_free_space("D:");
?>

注: 本函數不能作用於遠端檔案,被檢查的檔案必須通過伺服器的檔案系統訪問。

參見 disk_total_space()