时时商务社区
标题:
PHP 获取远程文件大小的3种解决方法
[打印本页]
作者:
bewin83
时间:
2018-2-14 08:15
1、使用file_get_contents()
[U]复制代码[/U] 代码如下:
2. 使用get_headers()
[U]复制代码[/U] 代码如下:
PS:
需要打开allow_url_fopen!
如未打开会显示
Warning: get_headers() [function.get-headers]: URL file-access is disabled in the server configuration
3.使用fsockopen()
[U]复制代码[/U] 代码如下:
您可能感兴趣的文章:
获取远程文件大小的php函数
从性能方面考虑PHP下载远程文件的3种方法
php下载远程大文件(获取远程文件大小)的实例
欢迎光临 时时商务社区 (http://bbs.4435.cn/)
Powered by Discuz! X3.2