Hello!
The following code returns everything to right of the last occurrence of a dash:
$string1 = 'some-random-string-123456';
$string2 = strrchr($string1, '-');
echo $string2;
output: -123456
is there a function that will return everything to the left of the last dash? so the out put would be:
some-random-string
Thanks!