PHP code example of hugsbrugs / php-ftp

1. Go to this page and download the library: Download hugsbrugs/php-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/ */

    

hugsbrugs / php-ftp example snippets



use Hug\Ftp\Ftp as Ftp;

Ftp::test($server, $user, $password, $port = 21);

Ftp::is_file($server, $user, $password, $remote_file, $port = 21);

Ftp::delete($server, $user, $password, $remote_file, $port = 21);

Ftp::rmdir($server, $user, $password, $remote_path, $port = 21);

Ftp::upload_dir($server, $user, $password, $local_path, $remote_path, $port = 21);

Ftp::download($server, $user, $password, $remote_file, $local_file, $port = 21);

Ftp::download_dir($server, $user, $password, $remote_dir, $local_dir, 
$port = 21);

Ftp::rename($server, $user, $password, $old_file, $new_file, $port = 21);

Ftp::mkdir($server, $user, $password, $directory, $port = 21);

Ftp::touch($server, $user, $password, $remote_file, $content, $port = 21);

Ftp::upload($server, $user, $password, $local_file, $remote_file = '', $port = 21);

Ftp::scandir($server, $user, $password, $path, $port = 21);

Ftp::pwd($server, $user, $password, $port = 21);

php example/test.php

composer