当前位置:网站首页>PHP get directory size
PHP get directory size
2022-06-26 12:23:00 【ζ He Yiyi】
function dirsize($dir)
{
@$dh = opendir($dir);
$size = 0;
while ($file = @readdir($dh)) {
if ($file != "." and $file != "..") {
$path = $dir . "/" . $file;
if (is_dir($path)) {
$size += dirsize($path);
} elseif (is_file($path)) {
$size += filesize($path);
}
}
}
@closedir($dh);
return $size;
}
边栏推荐
- Assembly language (7) operation instruction
- 开通证券账户需要注意事项 开户安全吗
- Black squares in word
- 2022 edition of Beijing 5g industry investment planning and development prospect forecast analysis report
- Analysis report on China's photovoltaic inverter market prospect forecast and investment strategy recommendations in 2022
- Pre knowledge of hash table -- binary search tree
- 2022 edition of China's cotton chemical fiber printing and dyeing Market Status Investigation and Prospect Forecast Analysis Report
- Introduction to Dolby panoramic sound
- This executeQuery (SQL) cannot compile classes for JSP. What is the reason?
- Leetcode 78. Subset and 90 Subset II
猜你喜欢

Jmeter响应时间和tps监听器使用教程
![[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure](/img/d5/db1931596c26090092aaa065103dbb.png)
[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure

Excel operation of manual moving average method and exponential smoothing method for time series prediction

Scala-day06- pattern matching - Generic

Omnichannel membership - tmall membership 1: opening tutorial

1、 MySQL introduction

Quantitative elementary -- akshare obtains stock code, the simplest strategy

Laravel+gatewayworker completes the im instant messaging and file transfer functions (Chapter 4: server debugging errors)

【Redis 系列】redis 学习十六,redis 字典(map) 及其核心编码结构

International beauty industry giants bet on China
随机推荐
[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure
【毕业季·进击的技术er】忆毕业一年有感
国际美妆业巨头押注中国
Jsonarray and jsonobject of fastjson [easy to understand]
UDP protocol details [easy to understand]
2022 edition of Beijing 5g industry investment planning and development prospect forecast analysis report
Pre knowledge of hash table -- binary search tree
开通证券账户需要注意事项 开户安全吗
I want to know how the top ten securities firms open accounts? Is online account opening safe?
菜鸟实战UML——活动图
[graduation season · advanced technology Er] I remember the year after graduation
PHP laravel+gatewayworker completes im instant messaging and file transfer (Chapter 1: basic configuration)
Ad - update the modified PCB package to the current PCB
11、 Box styles and user interface
This executeQuery (SQL) cannot compile classes for JSP. What is the reason?
[solved] data duplication or data loss after laravel paginate() paging
Scala-day05-set
Build document editor based on slate
大智慧哪个开户更安全,更好点
Question B of 2016 Sichuan Ti Cup Electronic Design Competition