I\'m trying to download a file from an ftp server using curl and php but I can\'t find any documentation to help
$curl = curl_init();
curl_setopt($curl, CURL
After trying all of these answers and having none of them work, this is what I finally got to work.
$curl = curl_init();
$fh = fopen("FILENAME.txt", 'w');
curl_setopt($curl, CURLOPT_URL, "ftp://{$serverInfo['username']}:{$servererInfo['password']}@{$serverInfo['server']}/{$serverInfo['file']}");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl);
fwrite($fh, $result);
fclose($fh);
curl_close($curl);