Get the characters before the last "-" (dash)
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5939412/php-string-function-to-get-substring-before-the-last-occurrence-of-a-character">php string function to get substring before the last occurrence of a character</a>  </p>
</blockquote>



<p>I have a value like this <code>$number= 01-01-02-001000</code>. </p>

<p>Could you please tell me how to get the <code>01-01-02</code> part separated in a variable from <code>$number</code>?</p>

<p>The output I am trying to achieve is <code>01-01-02</code></p>

<p>Thanks in Advance</p>
