Reputation: 251
I have the following :
$variable = bl45789;
The value bl
will be always included in my variable.
How can I get only 45789.
With explode maybe ?
Upvotes: 0
Views: 41
Reputation: 1788
$var = 'bl45789';
preg_match_all('!\d+!', $var, $result);
echo $result; // will display 45789
Upvotes: 1