磁盘容量

最后更新于:2022-04-02 02:32:29

[TOC] ## 示例 ``` const BYTES_IN_GIGABYTE = 1024*1024*1024; $total_space_bytes = disk_total_space("/"); $free_space_bytes = disk_free_space("/"); $total_space_gb = floor($total_space_bytes / BYTES_IN_GIGABYTE); $free_space_gb = floor($free_space_bytes / BYTES_IN_GIGABYTE); echo "总空间: $total_space_gb GB\n"; // 总空间: 465 GB echo "可用空间: $free_space_gb GB\n"; // 可用空间: 362 GB ```
';