Home >php教程 >php手册 >Introduction to php disk_free_space and disk_total_space examples

Introduction to php disk_free_space and disk_total_space examples

WBOY
WBOYOriginal
2016-10-28 15:03:311333browse

php disk_free_space function and disk_total_space function tutorial, the first function refers to the space returned by the function, in bytes, in the specified directory, and the disk_total_space function returns the total space

Definition and Usage

The disk_free_space() function returns the free space, in bytes, in the specified directory.

Grammar:

<span style="color: #008080">disk_free_space</span>(directory)  

Let’s take a look at the disk_free_space instance.

<?<span style="color: #000000">php  
</span><span style="color: #008000">//</span><span style="color: #008000"> by http://www.manongjc.com/article/1324.html  </span>
<span style="color: #0000ff">echo</span> <span style="color: #008080">disk_free_space</span>("C:"<span style="color: #000000">);  
</span>?>  

Output the size of your hard drive.

12312312313  

Let’s take a look at the tutorial on the disk_total_space function.

Definition and Usage

The disk_total_space() function returns the total space, in bytes, in the specified directory.

Grammar

<span style="color: #008080">disk_total_space</span>(directory) 

Example:

<?<span style="color: #000000">php   
</span><span style="color: #008000">//</span><span style="color: #008000"> by http://www.manongjc.com/article/1324.html  </span>
<span style="color: #0000ff">echo</span> <span style="color: #008080">disk_total_space</span>("C:"<span style="color: #000000">);  
</span>?>  

The method is the same as disk_free_space.

Statement:
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