PHP ftp_size() 函数

PHP 教程 · 2019-01-26 13:44:42

定义和用法

ftp_size() 函数返回 FTP 服务器上指定文件的大小。

该函数以字节返回指定文件的大小,如果出错则返回 -1。

语法


ftp_size(ftp_connection,file)


参数 描述
ftp_connection 必需。规定要使用的 FTP 连接。
file 必需。规定要检查的文件。

提示和注释

注释:并非所有 FTP 服务器均支持该函数。

实例


<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
echo ftp_size($conn,"test.txt");
ftp_close($conn);
?> 

上面的代码将输出:


160


点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Using Google App Engine

Using Google App Engine

Charles Severance / O'Reilly Media / 2009-5-23 / USD 29.99

With this book, you can build exciting, scalable web applications quickly and confidently, using Google App Engine - even if you have little or no experience in programming or web development. App Eng......一起来看看 《Using Google App Engine》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具