<?php $phone = preg_replace( '/\s+/', '', "01234 567890" ); echo $phone;
$string = str_replace(' ', '', $string);
<?php $stripped = str_replace(' ', '', "10 1000 0000 000"); echo $stripped;
$str = "\n\n\nHello World!\n\n\n"; echo "With trim: " . trim($str);
$string = "this is my string" $string = preg_replace('/\s+/', '', $string);