title: PHP: best method to trim a substring from a string
body: <p>Want to process a set of strings, and trim some ending "myEnding" <em>from the end</em> of each string <em>if it exists</em>.  </p>
  
  <p>What is the simplest way to do it?
  I know that everything is possible with regexp, but thus seems to be a simple task, and I wonder whether a simpler tool for this exists.</p>
  
  <p>Thanks</p>
  
  <p>Gidi</p>