If when trying to use this function you get "Warning: ssh2_scp_send(): Failure creating remote file," then try using
$data = file_get_contents("ssh2.sftp://$sftp/path/to/file");
If when trying to use this function you get "Warning: ssh2_scp_send(): Failure creating remote file," then try using
$data = file_get_contents("ssh2.sftp://$sftp/path/to/file");