Id use either is_numeric but that wont allow $ signs
So you need to use regex
$string = preg_match("[$][0-9]",$string);
if($string != 1)
{
//not valid
}
else
{
//valid
}
Not sure how you would replace the non-numeric characters so thats probably a good start.
Not sure if the regex works though i didnt test it.