<?php$numbers_only_string = preg_replace('/\D/', '', $string);?>
Yeah, that there's a regexp character for "not a digit". Craziness.