treeleaf20 Posted August 24, 2011 Share Posted August 24, 2011 All, I'm trying to use some code to get some file contents from another website and am looking at performance. What is the quicker way and better for my resources to get out to websites, is it cURL or by using file_get_contents? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/245596-file_get_contents-vs-curl/ Share on other sites More sharing options...
codefossa Posted August 24, 2011 Share Posted August 24, 2011 I would suggest cURL as there's many benefits to it, such as spoofing a browser, using cookies, setting timeouts, etc. I'm not sure that one is quicker than the other, but cURL can be made to look like an actual user. Quote Link to comment https://forums.phpfreaks.com/topic/245596-file_get_contents-vs-curl/#findComment-1261392 Share on other sites More sharing options...
WebStyles Posted August 24, 2011 Share Posted August 24, 2011 there's some benchmarking tests done here: http://stackoverflow.com/questions/555523/file-get-contents-vs-curl-what-has-better-performance Don't know how valid they are, but it seems curl is faster. Quote Link to comment https://forums.phpfreaks.com/topic/245596-file_get_contents-vs-curl/#findComment-1261397 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.