elinberg

file_get_contents

May 30th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.26 KB | None | 0 0
  1. $username = 'username';
  2. $password = 'password';
  3.  
  4. $context = stream_context_create(array(
  5.     'http' => array(
  6.         'header'  => "Authorization: Basic " . base64_encode("$username:$password")
  7.     )
  8. ));
  9. $data = file_get_contents($url, false, $context);
Add Comment
Please, Sign In to add comment