Created
February 15, 2022 05:00
-
-
Save AkostDev/17d3a5d9c2f34b1d869f40c3523166d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!function_exists('getallheaders')) { | |
function getallheaders(): array | |
{ | |
$headers = []; | |
foreach ($_SERVER as $name => $value) { | |
if (str_starts_with($name, 'HTTP_')) { | |
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; | |
} | |
} | |
return $headers; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment