oh, for your purpose it is enough to make
$html_code = str_replace(",","",$html-code);
$html_code = str_replace("$", "", $html_code);
str_replace is more simple and mostly faster than preg_replace, for that you shouldn't use preg if you don't really need it 🙂
anyway, the right mode to use preg_replace would be:
$html_code = preg_replace( '/,/', '', $html_code );
// remove dollar sign.
$html_code = preg_replace('/\$/','',$html_code );
also be careful! the dollar sign has a special purpose in PCRE, which means you have to mask it in the regular expression by a backslash to be able to find it. otherwise the dollar sign means the "ending" of the regular expression.
this wouldn't also be a problem if you used str_replace instead.