1. Go to this page and download the library: Download coercive/sftp 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/ */
coercive / sftp example snippets
use Coercive\Utility\SFTP\SFTP;
$SFtp = new SFTP('127.0 0.1', 22);
$SFtp->login('BestUser', 'BestPassword');
$SFtp->connect();
$SFtp->setTmpPrefix('_test_tmp_prefix_');
$SFtp->download('/example/dir/test/test.md', $filepath);
# do something with your file
rename($filepath, '/test/dowloaded_file.md');