How can I get only the first values until "-"
Like for example: I have a string,
$title = "9283-returns-to-normal-in-1989";
or
$title = "83-returns-to-normal-in-1989";
or
$title = "9283231-returns-to-normal-in-1989";
I wanted to only get the first numerical values in that string until "-". So that, I can only get 9283
, 83
or 9283231
no matter how many values in it.
Please help