Home >Backend Development >PHP Tutorial >How to use filesize function

How to use filesize function

藏色散人
藏色散人Original
2019-02-15 10:42:142715browse

php filesize() function is used to obtain the file size.

How to use filesize function

php filesize() function Syntax

Function: Return the size of the specified file.

Syntax:

filesize(filename)

Parameters:

filename Required. Specifies the documents to be checked.

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

php filesize() function example

<?php
$file = filesize("./test.txt");
echo $file;
?>

Output:

51

This article is an introduction to the PHP filesize function. I hope it will be helpful to friends in need!

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

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