How secure is the transmission when using file_get_contents() to retrieve data from a MySQL database on another server?

When using file_get_contents() to retrieve data from a MySQL database on another server, the transmission is not secure as the data is sent over plain text. To secure the transmission, you should use HTTPS to encrypt the data being transferred between the servers.

$url = 'https://example.com/data.php'; // URL of the script on the remote server
$data = file_get_contents($url);