OK, let's say you have a file called file.txt and the contents are as follows:
John
Mary
Sam
Mike
Dave
The following code will pull
$lines = file('http://www.domain.com/file.txt');
print_r($lines);
This will output:
array([0] => John, [1] => Mary, [2] => Sam, [3] => Mike, [4] => Dave)
The file function grabs the lines, and puts them into an array for you.
If your file looks more like this:
John,Mary,Sam,Mike,Dave
Then you'd need to do something more like this (which gives the same output):
$handle = file_get_contents("http://www.domain.com/file.txt", "rb"); // Need the b if on a Windows machine
$array = explode(",", $handle);
print_r($array);