Opening up an URL and reading data from it is simple using the Streams API:

 1: php_stream *stream;
 2: 
 3: stream = php_stream_open_wrapper("http://www.php.net",
 4:         "rb", REPORT_ERRORS, NULL);
 5: 
 6: if (stream == NULL) {
 7:     return;
 8: }
 9:         
10: while (!php_stream_eof(stream)) {
11:     char buf[1024];
12: 
13:     if (php_stream_gets(stream, buf, sizeof(buf)) {
14:         php_printf("%s", buf);
15:     } else {
16:         break;
17:     }
18: }
19: php_stream_close(stream);