View Single Post
  #12 (permalink)  
Old 06-02-2008, 04:16 AM
Jeyaseelansarc Jeyaseelansarc is offline
D-Web Genius
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,162
Jeyaseelansarc is on a distinguished road
Send a message via AIM to Jeyaseelansarc
Default Re: Streaming in PHP

stream_context_create() creates and returns a stream context

Example:
PHP Code:
<?php
$opts 
= array(
  
'http'=>array(
    
'method'=>"GET",
    
'header'=>"Accept-language: en\r\n" 
              
"Cookie: foo=bar\r\n"
  
)
);

$context stream_context_create($opts);

/* Sends an http request to www.example.com
   with additional headers shown above */
$fp fopen('http://www.example.com''r'false$context);
fpassthru($fp);
fclose($fp);
?>
__________________
With,
J. Jeyaseelan

Everything Possible
Reply With Quote