You can do this a couple ways, but I would be careful with this.
Are we talking a binary or text file?
if you are doing a text file, I would just use file("$url"), that will put the html/txt file into an array by line.
If you need to do a binary I would look at fopen().