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

2009-09-16 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

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-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. but

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 are up.

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

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

2009-09-15 Thread Tommy Pham
--- On Tue, 9/15/09, CRM c...@globalissa.com wrote: From: CRM c...@globalissa.com 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