Solution:1
To extract everything before the last dash (-), use strrpos() to locate the final dash and substr() to cut the string up to that position:
$output = substr($number, 0, strrpos($number, '-'));
$number → your input string.
strrpos($number, ‘-‘) → finds the position of the last dash.
substr(…) → returns the substring from the beginning up to (but not including) that last dash.