Are there specific functions in PHP that support SFTP file transfers?

To support SFTP file transfers in PHP, you can use the `ssh2_sftp` functions provided by the SSH2 extension. This extension allows you to establish an SFTP connection and perform file operations such as uploading, downloading, and deleting files securely over SSH.

// Establish SSH connection
$connection = ssh2_connect('hostname', 22);
ssh2_auth_password($connection, 'username', 'password');

// Initialize SFTP subsystem
$sftp = ssh2_sftp($connection);

// Upload a file to the remote server
$remoteFile = "ssh2.sftp://$sftp/path/to/remote/file.txt";
$localFile = "path/to/local/file.txt";
if (copy($localFile, $remoteFile)) {
    echo "File uploaded successfully.";
} else {
    echo "Failed to upload file.";
}