Connecting Tech Pros Worldwide Help | Site Map

Which do you use most and why: fsockopen, curl, fopen, file_get_contents

Familiar Sight
 
Join Date: Jan 2009
Posts: 165
#1: 4 Weeks Ago
Out of these, which one do you use most and why ?

fsockopen, curl, fopen, file_get_contents,
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#2: 4 Weeks Ago

re: Which do you use most and why: fsockopen, curl, fopen, file_get_contents


fsockopen - used by the mail script
file_get_contents - if I need the complete file content (same server)
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,936
#3: 4 Weeks Ago

re: Which do you use most and why: fsockopen, curl, fopen, file_get_contents


They all have their own tasks.
  • fsockopen(): open a socket connection
  • fopen(): open a file for reading/writing
  • cURL: does lots of different things. I generally use it for sending form data programatically
  • file_get_contents(): read data of a file

As an estimate, I would say I use file_get_contents() the most, just because I most often need to read the data from a file.
Familiar Sight
 
Join Date: Jan 2009
Posts: 165
#4: 4 Weeks Ago

re: Which do you use most and why: fsockopen, curl, fopen, file_get_contents


Thanks very much for your replies

anyone else ?
Reply