I am using the following format in php code to download files from ftp server.
file_put_contents( $filePath.$fileName, file_get_contents(
true == ( $data = @ file_get_contents('ftp://username:password@server_name/folder_name/xyz#123.csv') ) ? file_put_contents('xyz#123.csv', $data) : exit;