PHP code example of anchu / ftp

1. Go to this page and download the library: Download anchu/ftp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

anchu / ftp example snippets


Config::set('ftp.connections.key', array(
           'host'   => '',
           'username' => '',
           'password'   => '',
           'passive'   => false,
           'secure'   => false,
));

FTP::connection()->getDirListing(...);

FTP::connection('foo')->getDirListing(...);

FTP::reconnect('foo');

FTP::disconnect('foo');

// With custom connection
$listing = FTP::connection('my-ftp-connection')->getDirListing();

// with default connection
$listing = FTP::connection()->getDirListing();
$status = FTP::connection()->makeDir('directory-name');