Удалить пространство из строки PHP
<?php
$stripped = str_replace(' ', '', "10 1000 0000 000");
echo $stripped;
Unusual Unicorn
<?php
$stripped = str_replace(' ', '', "10 1000 0000 000");
echo $stripped;
$string = preg_replace('/\s+/', '', $string);
<?php
$phone = preg_replace( '/\s+/', '', "01234 567890" );
echo $phone;
$str = "\n\n\nHello World!\n\n\n";
echo "With trim: " . trim($str);
//remove all white spaces from a string
$whatonearth=preg_replace('/\s/','',"what o n ear th");
<?php
$name = "Yeasin_ahammed_apon"
#str_replace('what u want to replace', 'with what ', $name);
str_replace('_', ' ', $name);
echo $name;
# output: Yeasin ahammed apon
?>
#str_replace('what u want to replace', 'with what ', $name);