I want to extract numbers from a string in PHP like following :
if the string = \'make1to6\' i would like to extract the numeric charac
You can use a regular expression as such, it should match exactly your specification:
$string = 'make6to12'; preg_match('{^.*?(?P\d{1,2})to(?P\d{1,2})}m', $string, $match); echo $match['before'].', '.$match['after']; // 6, 12