开发者

Getting the contents of a file with PHP FTP

开发者 https://www.devze.com 2022-12-21 14:07 出处:网络
I am trying to get the contents of a file on a remote FTP server through PHP.Looking a开发者_JAVA技巧t all the docs though it doesn\'t appear possible to do this without first saving the transferred f

I am trying to get the contents of a file on a remote FTP server through PHP. Looking a开发者_JAVA技巧t all the docs though it doesn't appear possible to do this without first saving the transferred file to disk and then opening it.

Is there any way of reading the file straight into a variable or buffer without having to save it to disk first?

Thanks.


file_get_contents can use FTP stream wrappers too

$content = file_get_contents('ftps://user:password@example.com/pub/file.txt');
0

精彩评论

暂无评论...
验证码 换一张
取 消