PHP, Return everything to the left, strrchr()?
<p>The following code returns everything to right of the last occurrence of a dash:</p>

<pre><code>$string1 = 'some-random-string-123456';
$string2 = strrchr($string1, '-');

echo $string2;

output: -123456
</code></pre>

<p>is there a function that will return everything to the left of the last dash? so the out put would be:</p>

<pre><code>some-random-string
</code></pre>
