<?php preg_replace('/\s+/', '', the_sub_field('price')); ?>
<?php preg_replace('/[^0-9]+/', '', the_sub_field('price')); ?>
<?php str_replace(' ', '', the_sub_field('price')); ?>
<?php echo preg_replace('/\s+/', '', the_sub_field('price')); ?>