No need to use preg_replace here as you're only getting rid of simple strings. Use str_replace with an arrays for the parameters.
$search = array('$',',',' ');
$replace = array('','','');
$price=str_replace($search, $replace, $price);
I don't know if it would work but you could try the following syntax to save a few chars (put them box and save them up for christmas!😉)
$search = array('$', ',',' ');
$price = str_replace($search, '', $price);
Give it a try and let us know if it works 🙂
Bubble