title: How to comma separate the values of an array for display
body: <p>I have searched the PHP.net site and originally thought of some use for the <code>list()</code> function but doesn't seem to accomplish the goal:</p>
  
  <p>I have an unknown number of values stored in a single array</p>
  
  <p><code>$array1 = array(1,2,3,4,5);</code></p>
  
  <p>or </p>
  
  <p><code>$array1 = array(1,2,3);</code></p>
  
  <p>I want to be able to echo (or <code>print_r</code>) the values contained within an array to screen and separated only by commas and spacing.</p>
  
  <p>For example:</p>
  
  <p>the 'idea' is to have echo <code>$array1</code> to display:</p>
  
  <p>1,2,3</p>
  
  <p>from the second example above. </p>