Skip to content

Instantly share code, notes, and snippets.

View kvnZero's full-sized avatar
💭
need some inspiration...

Lin kvnZero

💭
need some inspiration...
View GitHub Profile
@gabrysiak
gabrysiak / php-http-basic-auth.php
Created August 14, 2014 19:40
PHP - HTTP Request with Basic Authentication
$username = "some-username";
$password = "some-password";
$remote_url = 'http://www.somedomain.com/path/to/file';
// Create a stream
$opts = array(
'http'=>array(
'method'=>"GET",
'header' => "Authorization: Basic " . base64_encode("$username:$password")
)