|
Posted by typingcat on 10/25/05 05:40
Thank you, Ramon.
I've visited the manual page, and found, there is a more appropriate
method.
[Scrap]
admin at sellchain dot com
17-Oct-2005 10:34
TIP: If you are using fopen and fread to read HTTP or FTP or Remote
Files, and experiencing some performance issues such as stalling,
slowing down and otherwise, then it's time you learned a thing called
cURL.
Performance Comparison:
10 per minute for fopen/fread for 100 HTTP files
2000 per minute for cURL for 2000 HTTP files
cURL should be used for opening HTTP and FTP files, it is EXTREMELY
reliable, even when it comes to performance.
I noticed when using too many scripts at the same time to download the
data from the site I was harvesting from, fopen and fread would go into
deadlock. When using cURL i can open 50 windows, running 10 URL's from
each window, and getting the best performance possible.
Just a Tip :)
Ramon wrote:
> My apologies, I missunderstood.
>
> But fopen should still work: *fopen -- Opens file or URL*
>
> Have a read of the fopen documentation entry.
>
>
>
>
> typingcat@gmail.com wrote:
> > The web page I'm trying to read is not on the same server. Does fopen
> > also work for this? Can I read www.microsoft.com with fopen?
> >
> > Ramon wrote:
> >
> >>I think if you go to http://www.php.net/documentation
> >>
> >>You will find that in the documentation there is an entire section
> >>dedicated to Filesystem. With many different functions that you may find
> >>useful: eg. fread, fopep anbd many more.
> >>
> >>
> >>
> >>typingcat@gmail.com wrote:
> >>
> >>>Is it possible to read another web page in PHP?
> >>>If is ASP.NET, the code would be
> >>>------------
> >>>WebRequest req=WebRequest.Create("http://www.microsoft.com");
> >>>WebResponse res=req.GetResponse();
> >>>StreamReader sr = new StreamReader(res.GetResponseStream());
> >>>String Output=sr.ReadToEnd();
> >>>Response.Write("The content is : " + Output);
> >>>--------
> >>>
> >>>Would you please tell me the PHP equivalant of this code? Thank you.
> >>>
> >
> >
Navigation:
[Reply to this message]
|