title: PHP add multiple strings within a string at multiple positions
body: <p>While this works perfectly, looking for a way to make it a little / lot cleaner, and also to learn along the way!!!
  I am adding <strong>/thumbs</strong> to a directory and file string, and also adding <strong>_thumb</strong> to the end of the file name of that same string.</p>
  
  <p>from this... Gallery/Test/Image/image.jpg</p>
  
  <p>to this... Gallery/Test/Image/thumbs/image_thumb.jpg</p>
  
  <p>but the paths can change in length depending on the directory structure, but /thumbs will always be the last directory, and _thumb will always be before the "."</p>
  
  <pre><code>    $thumb_dir = substr($file, 0, strrpos($file, '/')) . '/thumbs' . substr($file, strrpos($file, '/'));
  
      $thumbnail = substr($thumb_dir, 0, strrpos($thumb_dir, '.')) . '_thumb' . substr($thumb_dir, strrpos($thumb_dir, '.'));
  </code></pre>
  
  <p>Thanks</p>