Skip to content

Instantly share code, notes, and snippets.

View i-heart-php's full-sized avatar

Mike Vardy i-heart-php

  • Belleville, Ontario
View GitHub Profile
@i-heart-php
i-heart-php / ftp_download.php
Created November 27, 2018 11:14 — forked from staatzstreich/ftp_download.php
Download a directory from an FTP Server
<?php
// ftp_sync - copy directory and file structure
// based on http://www.php.net/manual/es/function.ftp-get.php#90910
// main function witch is called recursivly
function ftp_sync($dir, $conn_id) {
if ($dir !== '.') {
if (ftp_chdir($conn_id, $dir) === FALSE) {
echo 'Change dir failed: ' . $dir . PHP_EOL;
return;