You are here

function headers_from_lines in Auth0 Single Sign On 8.2

Parses an array of header lines into an associative array of headers.

Parameters

iterable $lines Header lines array of strings in the following: format: "Name: Value"

Return value

array

File

vendor/guzzlehttp/guzzle/src/functions.php, line 63

Namespace

GuzzleHttp

Code

function headers_from_lines($lines) {
  $headers = [];
  foreach ($lines as $line) {
    $parts = explode(':', $line, 2);
    $headers[trim($parts[0])][] = isset($parts[1]) ? trim($parts[1]) : null;
  }
  return $headers;
}