I have data for example
8789 WWW xxx 8739
and if the value like this, the value still 786-456 not 786
786-456
I want to get numeric before string character, how to do that?
the result should be
8789
786-456
here is the code that I have made
$string = '123 home/cat1/subcat2/';
$first = strtok($string, "/^[a-zA-Z]");
echo $first;
the result that I want should be
123