Finally this code,
Code: Select all
$sftp = ssh2_sftp($conn);
$file = fopen("ssh2.sftp://$sftp/path-to-file-on the remote server", "w")
fputs($file, $var);
//$var is the variable where I stored the database output that needed to be sent to the file server
fclose($file);May be someone else could also use it.
Thanks
-Nayeem