Friday, June 3, 2011

PHP file_get_contents 사용시 쿠키(cookie) 설정하기

<?php// Create a stream$opts = array(
  
'http'=>array(
    
'method'=>"GET",
    
'header'=>"Accept-language: en\r\n" .
              
"Cookie: foo=bar; tellme=what\r\n"
  
)
);
$context stream_context_create($opts);
// Open the file using the HTTP headers set above$file file_get_contents('http://www.example.com/'false$context);?>

No comments:

Post a Comment