title: Split a PHP array into a string
body: <p>I have an array like the one below, which actually collects login and other data from a user submitted form, to be written to a DB. I don't need all the form data, and hence this approach.</p>
  
  <pre><code>$array['a']  = $_POST['userName'];
  $array['a'] .= $_POST['passWord'];
  </code></pre>
  
  <p>Which results in:</p>
  
  <pre><code>$array['a']  = 'username@example.com';
  $array['a'] .= 'password';
  </code></pre>
  
  <p>I'm trying to get values from the array as a string, sperated by <code>,</code> or <code>::</code>, but just cannot figure how to do it.</p>
  
  <p>Using implode gives me a continious string like <code>username@example.compassword</code></p>
  
  <p><code>$comma_separated = implode($array);</code>
  <code>echo $comma_separated;</code></p>
  
  <p>Is it somehow possible to get a string like <code>::username@example.com ::passpword</code> from the array without a for loop.</p>
  
  <p>The approach cannot be changed since it's already in a working site.</p>
  
  <p>I'm using PHP 7.0 on a Windows 10 Machine for testing.</p>