What modifications need to be made to a PHP script to allow loading a text file from an external URL?

To load a text file from an external URL in a PHP script, you need to use the `file_get_contents()` function. This function allows you to retrieve the contents of a file from a specified URL. You simply need to pass the URL of the text file as a parameter to `file_get_contents()` to load the file contents into a variable.

$url = 'https://www.example.com/textfile.txt';
$text = file_get_contents($url);

echo $text;