title: Remove last character in a path string if it is a slash
body: <p>I'm doing some url rewriting in PHP and need to find URLS with a slash at the end and then do a 301 redirect.  I thought there'd be a simple PHP function to find last string, but I couldn't find anything.  First instincts make m think I need to use regex, but I'm not 100%.  </p>
  
  <p>Here's one example:  </p>
  
  <p><a href="http://domainx.com/characters/" rel="noreferrer">http://domainx.com/characters/</a> I want to find a trailing slash and turn it into <a href="http://domainx.com/characters" rel="noreferrer">http://domainx.com/characters</a></p>
  
  <p>So what function will help me check if the last character is a "/"?</p>