<?php
$stripped = str_replace(' ', '', "10 1000 0000 000");
echo $stripped;
<?php
$phone = preg_replace( '/s+/', '', "01234 567890" );
echo $phone;
$string = "this is my string";
$string = preg_replace('/s+/', '', $string);
phpCopy<?php
$searchString = " ";
$replaceString = "";
$originalString = "This is a programming tutorial";
$outputString = preg_replace('/s+/', '', $originalString);
echo("The original string is: $originalString
");
echo("The string without spaces is: $outputString
");
?>
//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);
phpCopy<?php
$searchString = " ";
$replaceString = "";
$originalString = "This is a programming tutorial";
$outputString = str_replace($searchString, $replaceString, $originalString);
echo("The original string is: $originalString
");
echo("The string without spaces is: $outputString");
?>