Get the App
SLTechnology News&Howtos  ›  Development  › 

How to get the basic properties of a file by PHP

Shulou Source: shulou.com Published: 2022-06-03 17:30:32 11月03日 Update

This article introduces the relevant knowledge of "how to obtain the basic attributes of files by PHP". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Filesize ($filename) returns the specified file size.

The number of bytes of the file size is returned if successful, or FALSE if it fails.

2. Filetype ($filename) returns the specified file or directory type.

If successful, one of the following seven possible values is returned:

Fifo

Char

Dir

Block

Link

File

Unknown

If it fails, FALSE is returned.

3. Fileperms ($filename) returns the permissions of the file or directory $filename.

If successful, permissions are returned numerically. If it fails, FALSE is returned.

This is the end of the content of "how to get the basic properties of a file by PHP". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Files successes attributes content size more permissions directories knowledge practicality achievements next dilemmas bytes actual form situations numbers articles cases Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Xiaomi NVidia MariaDB Shulou Information