Advertisement
Guest User

file get contents sample context

a guest
Aug 8th, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. $options = array(
  4.     'http' => array(
  5.         'timeout' => 100,
  6.         'method'  => 'POST',
  7.         'header'  => "Accept-language: en\r\n"
  8.                    . "Cookie: cookieName=value"
  9.         /*
  10.          * these are just some examples feel free to populate with anything your protocol (http in this case) supports
  11.          */
  12.     )
  13. );
  14.  
  15. $context = stream_context_create( $options );
  16. file_get_contents('http://someUrl', null, $context );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement