Home > php教程 > PHP源码 > body text

PHP获取系统分区信息(Linux)

PHP中文网
Release: 2016-05-25 17:08:57
Original
1626 people have browsed it


$pars = array_filter(explode("\n",`df -h`));
 
 
 foreach ($pars as $par) {
     if ($par{0} == '/') {
         $_tmp = array_values(array_filter(explode(' ',$par)));
         reset($_tmp);
         echo "分区挂载点:{$_tmp['5']},总大小:{$_tmp['1']}已使用:{$_tmp['2']}({$_tmp['4']})
";
     }
 }
Copy after login

                       

           

2. [图片] 未命名1.jpgPHP获取系统分区信息(Linux)    

PHP获取系统分区信息(Linux)

                   

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template