[SOLVED] file_get_contents vs fsockopen + fputs

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

[SOLVED] file_get_contents vs fsockopen + fputs

Post by anjanesh »

Is there a difference in speed in using file_get_contents() vs fsockopen + fputs for GETting file contents ?

Thanks
Last edited by anjanesh on Wed Aug 17, 2005 11:48 am, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

why not try it and find out? :?
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Im not able to find the difference for one url - to get a stats I need to pull a 1000 of atleast.
I just wanted to know if the mechanism is different or not. Or does file_get_contents actually use sockets in the backgorund to get the data ?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the url wrappers use sockets in the background to get it, yes.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Ah..Thanks for the info.
Post Reply