Since you're looking to do this in PHP I'll tell you how I would go about it if I had to use PHP but I won't give you the code to do it.
First I would iterate over every line in that text file
Then I would grab the URL and send a GET request to the URL using cURL (I recommend cURL if you're using PHP but you can use any HTTP library you like)
Have cURL return the file
Save said file to the directory of your choice
Here's documentation on PHP's implementation of cURL: http://php.net/manual/en/book.curl.php