RE: [PHP] best function to use ~ file_get_contents or ?

2009-09-16 Thread Andrea Giammarchi
This is what I said, except if you want to grab the content you need to request HEAD first and eventually GET, and this is slower than just GET parsing headers. In any case, curl is the answer, imho. Regards Requesting only the headers is a lot faster than requesting the headers AND the file

RE: [PHP] best function to use ~ file_get_contents or ?

2009-09-16 Thread Ashley Sheridan
On Wed, 2009-09-16 at 11:17 +0200, Andrea Giammarchi wrote: > > > > The way I've always seen this approached before is by using the wget > > command, which can be asked to just return the headers for a page. In > > your case you'd be looking for all 200 codes, which means that all the > > sites

RE: [PHP] best function to use ~ file_get_contents or ?

2009-09-16 Thread Andrea Giammarchi
> The way I've always seen this approached before is by using the wget > command, which can be asked to just return the headers for a page. In > your case you'd be looking for all 200 codes, which means that all the > sites are up. This is faster than asking to return a full image each > time.

Re: [PHP] best function to use ~ file_get_contents or ?

2009-09-16 Thread Ashley Sheridan
On Wed, 2009-09-16 at 12:08 +0530, Gaurav Kumar wrote: > There is no best function as such. Everything depends upon your requirement. > > You can also use fopen() to get the contents of the remote file and do some > error handling that if you get any content then display image else a message > etc

Re: [PHP] best function to use ~ file_get_contents or ?

2009-09-15 Thread Gaurav Kumar
There is no best function as such. Everything depends upon your requirement. You can also use fopen() to get the contents of the remote file and do some error handling that if you get any content then display image else a message etc.. Gaurav Kumar (Team Lead- open source) oswebstudio.com On W

Re: [PHP] best function to use ~ file_get_contents or ?

2009-09-15 Thread Tommy Pham
--- On Tue, 9/15/09, CRM wrote: > From: CRM > Subject: [PHP] best function to use ~ file_get_contents or ? > To: php-general@lists.php.net > Cc: i...@globalissa.com > Date: Tuesday, September 15, 2009, 5:36 PM > Hi All, > Not sure of the best approach, need your feedback. I

[PHP] best function to use ~ file_get_contents or ?

2009-09-15 Thread CRM
Hi All, Not sure of the best approach, need your feedback. I have 4 images on a website. These are used in navigation. When I load a reference webpage on my local machine the local page calls 4 images from an external website, each image will be on a different domain. What I want to see is if the