I'm wondering how to extract numbers from a string for example
$string = "1.8 to 250"
What i want to get is,
$a = 1.8
$b = 250
Thanks for any help provided
Try this :
$str = '1.8 to 250';
preg_match_all('!\d+!', $str, $matches);
print_r($matches);
From this post Extract numbers from a string