PHP fopen() for a url times out...
The part of script which is grabbing a page from yahoo financials for my stock analyzer goes a little something like this:
$open = fopen("http://screen.yahoo.com/b?gr=155%2F&peg=/1&b=1&z=gr&db=stocks&vw=1", "rb");
$haystack = fread($open, 20000);
fclose($open);
$pos = 0;
Anyways, it only grabs part of the page and then stops. Is this a time out? Every once in a while it grabs more or less than usual, although it generally is pretty consistent. I can only get enough data to parse 2 stock symbols out of the page when I need at least 10. How do I fix this?
Busy posted this at 05:05 — 10th September 2004.
He has: 6,151 posts
Joined: May 2001
try "r" instead of "rb"
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.