file-get-contents

How do I use file_get_contents to get a gzip'ed page on a remote web server in php?

I'm trying to receive a gzip'ed version of a page through file_get_contents in php 5.2.9 I was able to do it using fopen with the following code: $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "Accept-Encoding: gzip\r\n" ) ); $context = stream_context_create($opts); o...

reading large file from remote server using php script

I am trying to read large files lets say illustrator file or photoshop file using cron job in my system. Files size varies from 20 mb - 300 mb I have been using some function but it break in middle while reading. So i wanted to have a fresh opinion. Amount these function file_get_contents readfile curl which is most effective in te...

Process pages for a certain information using PHP

For example, I wish to mine http://stackoverflow.com/privileges/user/3 and get the data that is in the div <div class="summarycount al">6,525</div> so that I can add the reputation to a local db along with the usernumber. I think I can use file_get_contents $data = file_get_contents('http://stackoverflow.com/privileges/user/3'); How ...

file_get_contents failed to open stream, connected party did not respond

Hello all, When we use file_get_contents, what does PHP use to resolve the domain name (local DNS??). I ask because I got this error: Warning: file_get_contents(http://external-domain.com) [function.file-get-contents]: failed to open stream: A connection attempt failed because the connected party did not properly respond ...

Alternative to file_get_contents?

$xml_file = file_get_contents(SITE_PATH . 'cms/data.php'); The problem is that a server has URL file-access disabled. I cannot enable it, its a hosting thing. So the question is this. The data.php file generates xml code. How can I execute this and get the xml data without doing the above method? Is it possible? ...