title: PHP: Display comma after each element except the last. Using 'for' statement and no 'implode/explode'
body: <p>I have this simple for loop to echo an array:</p>
  
  <pre><code>for ($i = 0; $i &lt; count($director); $i++) {
     echo '&lt;a href="person.php?id='.$director[$i]["id"].'"&gt;'.$director[$i]["name"].'&lt;/a&gt;';
  }
  </code></pre>
  
  <p>The problem here is that when more than one element is in the array then I get everything echoed without any space between. I want to separate each element with a comma except the last one.</p>
  
  <p>I can't use <code>implode</code> so I'm looking for another solution</p>