In Linux, php obtains system partition information. How to obtain system partition information by using php in Linux this article mainly introduces how to obtain system partition information by using php in Linux, which involves the operating skills of php System Analysis in Linux, how to obtain system partition information using php in a Linux system
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']})
";
}
}
|
I hope this article will help you with php programming.
This article describes how to obtain system partition information by using php in a Linux system. it involves the operating skills of php System analysis in a Linux system...