Skip to content

Instantly share code, notes, and snippets.

@dionedomingo
Created June 26, 2020 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dionedomingo/b165eb70a371ca685894ce067d3c48ab to your computer and use it in GitHub Desktop.
Save dionedomingo/b165eb70a371ca685894ce067d3c48ab to your computer and use it in GitHub Desktop.
get all headers jwt_token
<?php
if (!function_exists('getallheaders'))
{
function getallheaders()
{
$headers = [];
foreach ($_SERVER as $name => $value)
{
if (substr($name, 0, 5) == 'HTTP_')
{
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}
if(!empty($headers['Jwttoken'])){
$headers['jwt_token'] = $headers['Jwttoken'];
}
return $headers;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment