title: Implode with array with keys in PHP
body: <p>I need to write an array to a .csv file in PHP.</p>
  
  <p>Example array:</p>
  
  <pre><code>$array = array(
      "name" =&gt; "John",
      "surname" =&gt; "Doe",
      "email" =&gt; "nowhere@nowhere.com"
  );
  </code></pre>
  
  <p>By using <code>implode(",", $array)</code>, I get a result like this:<br />
  <code>John,Doe,nowhere@nowhere.com</code></p>
  
  <p>However, I need to also write the key of each element to the file.<br /></p>
  
  <p>The desired output is this:<br />
  <code>name:John,surname:Doe,email:nowhere@nowhere.com</code></p>
  
  <p>How would I achieve this?</p>