This article focuses on issues related to PHP getting file size. Hope to be helpful to the needy friend. First, we introduce a PHP function, FileSize, which is
PHP gets the file size. Here's how to use it:
Output: Php File size 1024 bytes. Note: Because PHP's integer type is signed integer and many platforms use 32-bit integers, some file system functions may return unexpected results for files above 2GB.
then PHP determines the file size specific code example is as follows:
(Here are some simple operations on the database)
Note: First find the Database mpicture, select the table picture, execute the $p MySQL statement, and assign to result, get the number of result data, get the path of the image. Then use the IF statement to judge, less than 5K, then execute the code.
This article about the size of the PHP file access methods and the way to judge the introduction, there is a certain reference value, I hope to be helpful to everyone.