


PHP disk_free_space() function and disk_total_space() function description
disk_free_space — Returns the free space in the directory
Description
disk_free_space ( $directory )
Gives a string containing a directory , this function will return the number of available bytes based on the corresponding file system or disk partition.
Parameters directory
File system directory or disk partition.
Note:
If a file name is specified instead of a file directory, the behavior of this function will not be uniform and will vary depending on the operating system and PHP version.
Return value
Returns the number of available bytes in floating point, or FALSE on failure.
disk_free_space() Example
<?php // $df 包含根目录下可用的字节数 $df = disk_free_space ( "/" ); //在 Windows 下: $df_c = disk_free_space ( "C:" ); $df_d = disk_free_space ( "D:" ); ?>
Note: This function cannot be used on remote files. The file being checked must be accessible through the server's file system.
disk_total_space — Returns the total disk size of a directory
Description
disk_total_space ( $directory )
gives a character containing a directory String, this function will return all bytes according to the corresponding file system or disk partition. [Translator's Note] This function returns the total size of the disk partition where the directory is located, so the results obtained by giving different directories of the same disk partition as parameters are exactly the same. Mounting a disk partition as a subdirectory is supported in both Unix and Windows 200x/XP, in which case it makes sense to use this function correctly.
Parameters
directory The directory or disk partition of the file system.
Return value
Returns the total disk size of a directory in bytes in floating point, or FALSE on failure.
disk_total_space() Example
<?php // $df 包含 "/" 目录的磁盘大小 $ds = disk_total_space ( "/" ); //在 Windows 下: $ds = disk_total_space ( "C:" ); $ds = disk_total_space ( "D:" ); ?>
Note: This function cannot be used on remote files. The files being checked must be accessible through the server's file system.
The above is the detailed content of PHP disk_free_space() function and disk_total_space() function description. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

DALL-E 3 was officially introduced in September of 2023 as a vastly improved model than its predecessor. It is considered one of the best AI image generators to date, capable of creating images with intricate detail. However, at launch, it was exclus

The computer space key is at the bottom of the keyboard; the space key is the space bar, or blank key, which is a key on the computer keyboard; the space key is usually a long bar. The main reason for using this design is that it can easily enter spaces, such as in Two words are usually separated by a space, so the space bar is designed to be wider than any other key, allowing the thumbs of both hands to hit the space bar easily.

It is hard to imagine that the building materials for a planned lunar base would first have to be transported to Earth's satellite at great expense. After all, every pound counts when launching from the Earth's surface. The problem is the lunar regol

For computer repairmen, system enthusiasts, network administrators, and colleagues who often install and maintain systems, ghost software is very familiar to everyone! Ghost software can install the system, backup the system, restore the system, copy data, copy the entire hard disk, etc. Today, let’s learn how to use this software in detail: 1. This is the initial interface for opening the ghost software, click OK to enter. 2. Introduction to the functions of the ghost main interface. 3. Introduction to common functions of ghost. Local→Disk (operate on the entire hard disk) Local→Disk→ToDisk hard disk to hard disk (copy) →ToImage: hard disk to mirror (backup) →FromImage hard disk from mirror (restore) Loc

The AI-enabled Deepin Linux distro has just received its latest update, dubbed V23 RC2. This version of Deepin comes with a number of package updates and new features. But it's not all about the features; the look and feel are the main spotlight of t

In Linux systems, the free command is an important system tool used to monitor system memory usage. It provides basic usage to view information such as total memory, used amount, and available amount. In addition, there are some advanced uses, such as displaying detailed memory information, unit conversion, and real-time monitoring of memory. Basic usage of the free command: The basic syntax of the free command is as follows: free [options] Here are some commonly used options: -h: Display the memory size in a human-readable manner. -b: Display memory size in bytes. -k: Display memory size in kilobytes. -m: Display memory size in megabytes. -g: Display memory size in gigabytes. Sample Code: Let’s go through the sample code

In Linux, free is a built-in command to check the memory usage status. It can display the usage of system physical memory, virtual memory (swap partition), shared memory and system cache. The syntax is "free [option]"; the output of the free command Very similar to the memory part of the top command. Linuxfree command: Check the memory usage status The free command is used to display the system memory status, including the usage of system physical memory, virtual memory (swap partition), shared memory and system cache. Its output is very similar to the memory part of the top command. The basic format of the free command is as follows: #free [options] Table 1 lists the commonly used options of this command and their respective meanings. Table 1f

Samsung's Odyssey G9 gaming monitor range offers some of the best — and most expensive— high-refresh OLED and mini-LED gaming monitors around. Fortunately, a current sale on Samsung's site has brought those exorbitant prices down by as much as 46%. T
