“Usuń wszystkie przestrzenie PHP” Kod odpowiedzi

Usuń przestrzeń z String PHP

<?php
$stripped = str_replace(' ', '', "10 1000 0000 000");
echo $stripped;
Unusual Unicorn

Usuń każdy PHP Whitespace PHP

$string = preg_replace('/\s+/', '', $string);
LunkLoafGrumble

Usuń wszystkie przestrzenie PHP

$string = "this is my     string"
$string = preg_replace('/\s+/', '', $string);
King Pinaster

Usuń wszystkie przestrzenie ze sznurka w PHP

phpCopy<?php 
$searchString = " ";
$replaceString = "";
$originalString = "This is a programming tutorial"; 
 
$outputString = preg_replace('/\s+/', '', $originalString); 
echo("The original string is: $originalString \n");  
echo("The string without spaces is: $outputString \n"); 
?> 
CodeGuruDev

PHP usuń przestrzeń z ciągu

<?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);
polyglot orca

Usuń wszystkie przestrzenie ze sznurka w PHP

phpCopy<?php 
$searchString = " ";
$replaceString = "";
$originalString = "This is a programming tutorial"; 
 
$outputString = str_replace($searchString, $replaceString, $originalString); 
echo("The original string is: $originalString \n");  
echo("The string without spaces is: $outputString"); 
  
?> 
CodeGuruDev

Odpowiedzi podobne do “Usuń wszystkie przestrzenie PHP”

Pytania podobne do “Usuń wszystkie przestrzenie PHP”

Więcej pokrewnych odpowiedzi na “Usuń wszystkie przestrzenie PHP” w PHP

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu