Page 1 of 1

file_get_contents function inside the loop

Posted: Fri May 06, 2016 7:52 am
by peravino
Hi

When i use the file_get_contents function to retrive data from multiple url by using while loop, the codei works fine but it loads very slow. Can any one know what is the problem on my php code?

Re: file_get_contents function inside the loop

Posted: Fri May 06, 2016 8:26 am
by Celauran
It's a blocking request, so it's bound to be slow. Consider looking at curl_multi or Guzzle for asynchronous requests.