<?php $string = '0 foo 1 bar 2 baz 3 quux'; $int = preg_replace('/\D+/', '', $string); var_dump((int)$int);
You have javascript disabled. You will not be able to edit any code.