$the_int = ereg_replace("[0-9]", "", $original_str);
This will return "12345" from "12abc345".. it will remove all non-number characters from the string...
if you want to make sure that the numbers are together you can do this:
$the_int = ereg_replace("[0-9]{0,}([0-9]{0,})[0-9]{0,}", "\1", $original_str);
this will return nothig from "12abc345", but it will return "12345" from "12345abc", "abc12345" and "ab12345c"
Hope this helps you...
Andreas