Analysis on the Usage of PHP filesize Function

  • 2021-11-24 01:06:40
  • OfStack

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

If successful, the number of bytes of the file size is returned. If it fails, it returns false and generates an error of E_WARNING level.

php filesize () Function Syntax

Function: Returns the size of the specified file.

Syntax:


filesize(filename)

Parameters:

filename required. Documents to be inspected are specified.

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

Example of php filesize () Function


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

Output:./test. txt

Usage is actually very simple, we learn, thank you for the support of this site.


Related articles: