How to realize the possibility of transferring data from one FTP-server to another via FXP:
<?php
// ...
$ansver = ftp_raw($ftp_conn1, 'PASV');
if (intval($ansver[0]) == 227) {
ftp_raw($ftp_conn2, 'PORT '.substr($ansver[0], $n = strpos($ansver[0], '(') + 1, strpos($m[0], ')', $n) - $n));
ftp_raw($ftp_conn1, 'STOR '.$filename); // need asynchronously (non-blocking)
ftp_raw($ftp_conn2, 'RETR '.$filename);
}
?>