Skip to content

Instantly share code, notes, and snippets.

View mrniamster's full-sized avatar
🎯
Focusing

Niyam mrniamster

🎯
Focusing
View GitHub Profile
@mrniamster
mrniamster / bearer-token.php
Created March 6, 2022 23:53 — forked from wildiney/bearer-token.php
PHP - How to get and set Bearer Token
<?php
/**
* Get hearder Authorization
* */
function getAuthorizationHeader(){
$headers = null;
if (isset($_SERVER['Authorization'])) {
$headers = trim($_SERVER["Authorization"]);
}
else if (isset($_SERVER['HTTP_AUTHORIZATION'])) { //Nginx or fast CGI