title: How do I remove a comma off the end of a string?
body: <p>I want to remove the comma off the end of a string. As it is now I am using</p>
  <pre><code>$string = substr($string,0,-1);
  </code></pre>
  <p>but that only removes the last character of the string. I am adding the string dynamically, so sometimes there is no comma at the end of the string. How can I have PHP remove the comma off the end of the string if there is one at the end of it?</p>