I have following string:
15 asdas 26 dasda 354 dasd 1
and all that i want is to extract all numbers from it into an array, so it will looks li
You can use preg_match_all():
$string = '15 asdas 26 dasda 354 dasd 1'; preg_match_all('/\b(\d+)\b/', $string, $numbers); var_dump($numbers[1]);