Skip to content

Instantly share code, notes, and snippets.

@hranicka
Created September 18, 2017 09:36
Show Gist options
  • Save hranicka/38e6caeb673c3704257650e4f568bc8f to your computer and use it in GitHub Desktop.
Save hranicka/38e6caeb673c3704257650e4f568bc8f to your computer and use it in GitHub Desktop.
HTTP Basic Auth header generator
<?php
$user = '';
$pass = '';
$header = sprintf('Authorization: Basic %s', base64_encode(sprintf('%s:%s', $user, $pass)));
echo $header . "/n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment