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 could use preg_match_all to achive this:
preg_match_all
function getNumbersFromString($str) { $matches = array(); preg_match_all("/([0-9]+)/",$str,$matches); return $matches; } $matches = getNumbersFromString("hej 12jippi77");