This seems like it would be the most basic thing, maybe so basic that no one bothers to mention it. I've learned all the basic PHP syntax and some functions like fread()
and fopen()
, but I can't find a good way to download a URL into a string. Right now my best attempt is:
$someFile = fopen("http://www.pastats.com/report/winners?start=1386916400&duration=86400", r);
$someData = fread($someFile, filesize("http://www.pastats.com/report/winners?start=1386916400&duration=86400") );
but it doesn't work because apparently filesize
doesn't work if I don't have write permissions. I know there's got to be a really simple way of doing this.