php filesize 函数_PHP教程

WBOY
Release: 2016-07-20 11:01:04
Original
1256 people have browsed it

php filesize 函数

filesize
( PHP 4中, PHP 5中)

filesize-获取文件大小

描述
国际filesize(字符串$文件名)
获得大小给定的文件。

参数

文件名
文件路径。


返回值
回报文件的大小以字节为单位,或FALSE (和产生错误的水平E_WARNING )情况下的一个错误。

注意:由于PHP的整数类型的签署和许多平台使用32位整数,filesize( )可能会返回意想不到的结果的文件的容量大于2GB 。对于文件的2GB和4GB的大小这通常可以克服使用sprintf ( “ % U ”型,filesize( $档案) ) 。

实例

例如# 1filesize( )的例子

// outputs e.g. somefile.txt: 1024 bytes

$filename = 'somefile.txt';
echo $filename . ': ' . filesize($filename) . ' bytes';

?>


www.bkjia.com true http://www.bkjia.com/PHPjc/445469.html TechArticle php filesize 函数 filesize ( PHP 4中, PHP 5中) filesize-获取文件大小 描述 国际filesize(字符串$文件名) 获得大小给定的文件。 参数 文件名 文...
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!