从数组循环返回值并匹配关键字(php)

I have an array $headers that looks like this and I want to extract the server name only. The problem is the data is not always in the same order so I need to search for "Server" and return its value. I imagine i need to use a loop but cant figure out how to incorporate the search.

Sample of array $headers

array(13) {
  [0]=>
  string(15) "HTTP/1.1 200 OK"
  [1]=>
  string(19) "Server: nginx/1.6.2"
  [2]=>
  string(35) "Date: Fri, 08 May 2015 14:27:28 GMT"
  [3]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [4]=>
  string(17) "Connection: close"
  [5]=>
  string(25) "X-Powered-By: PHP/5.6.7-1"
  [6]=>
  string(44) "Last-Modified: Fri, 08 May 2015 14:20:12 GMT"
}

I would like to extract the server name nginx/1.6.2

Here is my loop that I need to build upon

foreach ($headers as $value) {
    echo "$value
";
}
$a = [
    "HTTP/1.1 200 OK",
    "Server: nginx/1.6.2",
    "Date: Fri, 08 May 2015 14:27:28 GMT",
    "Content-Type: text/html; charset=utf-8",
    "Connection: close",
    "X-Powered-By: PHP/5.6.7-1",
    "Last-Modified: Fri, 08 May 2015 14:20:12 GMT"
    ];

preg_match('/^Server: (.*)$/m', implode(PHP_EOL, $a), $matches);
echo $matches[1], PHP_EOL;

Output:

nginx/1.6.2

Assuming there is only one Server header:

$result = current(preg_grep('/^Server:/', $headers));

You can also look at http_parse_headers() but it takes the raw headers and not an array. If you don't have the raw headers you can still use it maybe:

$result = http_parse_headers(implode("
", $headers))['Server'];