Home > Backend Development > PHP Problem > How to use php filesize function

How to use php filesize function

藏色散人
Release: 2023-02-22 21:20:02
Original
2870 people have browsed it

php filesize function is used to return the size of the specified file. Its syntax is filesize(filename). If successful, it returns the number of bytes of the file size. If it fails, false is returned and an E_WARNING level error is generated.

How to use php filesize function

#How to use the php filesize function?

Definition and usage

filesize() function returns the size of the specified file.

If successful, return the number of bytes of the file size. On failure, returns false and generates an E_WARNING level error.

Syntax

filesize(filename)
Copy after login

Parameters

filename required. Specifies the documents to be checked.

Tips and comments

Tips: The results of this function will be cached. Please use clearstatcache() to clear the cache.

Example

<?php
echo filesize("test.txt");
?>
Copy after login

Output:

20
Copy after login

The above is the detailed content of How to use php filesize function. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template