<?php file_put_contents('./file.txt', file_get_contents('ftp://server/file.txt')); ?>
The FTP server should support passive mode ( ref ), and your web server should have allow_url_fopen
set to php.ini ( ref ).
Grant rights to use chmod('./file.txt', 0777)
or any other rights that you need.
andr source share