How to obtain system partition information using php in Linux
This article mainly introduces how to obtain system partition information by using php in a Linux system. It involves the operation skills of php system analysis in a Linux system and has some reference value. For more information, see
This article describes how to obtain system partition information by using php in Linux. Share it with you for your reference. The specific implementation method is as follows:
?
|
1
2
3
4
5
6
7
8
9
10 |
$ Pars = array_filter (explode ("\ n", 'df-H '));
Foreach ($ pars as $ par ){
If ($ par {0} = '/'){
$ _ Tmp = array_values (array_filter (explode ('', $ par )));
Reset ($ _ tmp );
Echo "partition mount point: {$ _ tmp ['5']},".
"Total size: {$ _ tmp ['1']}".
"Used: {$ _ tmp ['2']} ({$ _ tmp ['4']}) <br/> ";
}
}
|
I hope this article will help you with php programming.