title: strip php timestamp from filename, if it exists
body: <p>I'm trying to retrieve the filename of an image by removing the timestamp added to it. An image may or may not have a timestamp attached to it. For example it may be in this format:</p>
  
  <p><code>mylogo.1358256757.jpg</code></p>
  
  <p>or it may simply be:</p>
  
  <p><code>mylogo.jpg</code></p>
  
  <p>It could be <code>jpg</code>, <code>png</code> or any other valid image file.</p>
  
  <p>The timestamp was generated using:</p>
  
  <pre><code>$date = new DateTime();
  $timestamp = $date-&gt;getTimestamp();
  </code></pre>
  
  <p>I need a PHP regex that will retain the original image name, assuming:</p>
  
  <ul>
  <li>the image can have any possible filename, including as numbers and
  dots, and </li>
  <li>it may not have a timestamp at all!</li>
  </ul>
  
  <p>I can use substrings etc I'm just wondering what the safest way would be to go about it. Will a PHP timestamp always be exactly 10 digits?</p>