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 this:
// $str holds the string in question if (preg_match('/(\d+)to(\d+)/', $str, $matches)) { $number1 = $matches[1]; $number2 = $matches[2]; }