title: Remove Duplicates from Echoing in PHP Foreach
body: <p>I'm trying to use get the response headers using PHP.</p>
  
  <p>Here's my current code:</p>
  
  <pre><code>foreach ($headers as $name =&gt; $value) {
    foreach ($value as $key =&gt; $moreinfo) {
      echo "$name === $moreinfo \n";
    }
  }
  </code></pre>
  
  <p>I basically just don't want there to be multiple <code>$name</code> entries.</p>
  
  <p>For example, I'm currently seeing this being echoed:</p>
  
  <pre><code>date === Sun, 03 Nov 2019 03:03:11 GMT 
  date === Sun, 03 Nov 2019 03:03:11 GMT 
  via === 1.1 varnish 
  via === 1.1 varnish 
  connection === keep-alive 
  x-served-by === cache-bur17530-BUR 
  x-served-by === cache-bur17548-BUR 
  </code></pre>
  
  <p>I would want it changed to just showing this:</p>
  
  <pre><code>date === Sun, 03 Nov 2019 03:03:11 GMT 
  via === 1.1 varnish 
  connection === keep-alive 
  x-served-by === cache-bur17548-BUR 
  </code></pre>
  
  <p>Is there anything that could just be modified in the <code>foreach</code> to make this happen?</p>