scarhand Posted November 27, 2008 Share Posted November 27, 2008 is it more effective? Link to comment https://forums.phpfreaks.com/topic/134531-is-curl-better-than-file_get_contents/ Share on other sites More sharing options...
DarkWater Posted November 27, 2008 Share Posted November 27, 2008 Depends on what you're trying to do? file_get_contents() just grabs the file with a standard GET request, no questions asked. cURL can set cookies, and all sorts of stuff that real content grabbing might need, and it's also sometimes faster. Link to comment https://forums.phpfreaks.com/topic/134531-is-curl-better-than-file_get_contents/#findComment-700469 Share on other sites More sharing options...
.josh Posted November 27, 2008 Share Posted November 27, 2008 You can use curl to interact with other servers. For instance, serverA can use curl to post info to a page on serverB and retrieve the results (if any). file_get_contents, as darkwater said, simply grabs the page (the output, as in, what someone's browser would see) and puts it into a string. Link to comment https://forums.phpfreaks.com/topic/134531-is-curl-better-than-file_get_contents/#findComment-700518 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.