Just add another option because it is, although it is best to use a file. His other option, which I do not see anyone, is listed here.
$array = file("http://www.stackoverflow.com");
Well, if you want it in an array of strings, while the already mentioned get_contents file will put it in a string.
Another thing you can do.
Then you can loop through each line if that suits your purpose:
foreach($array as $line){ echo $line;
This is sometimes useful when some APIs splash out plain text or html with a new entry on each line.
Retronoodle
source share