Search
 
SCRIPT & CODE EXAMPLE
 

PHP

remove space from string php

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

php remove space before and after string

$words = '      my words     ';
$words = trim($words);
var_dump($words);
// string(8) "my words"
Comment

remove spaces from string php

<?php
$phone = preg_replace( '/s+/', '', "01234 567890" );
echo $phone;
Comment

remove all spaces php

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

remove whitespace from string php

$str = "


Hello World!


";
echo "With trim: " . trim($str);
Comment

Remove All Spaces Out of a String in PHP

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 
"); 
?> 
Comment

php remove space from string

<?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);
Comment

removed spacel caracter using php

<?php
$string = "DelftStack is a best platform.....";
echo "Output:  " . rtrim($string, ".");
?>
  Output: DelftStack is a best platform
Comment

Remove All Spaces Out of a String in PHP

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"); 
  
?> 
Comment

removed spacel caracter using php

<?php
$mainstr = "@@PHP@Programming!!!.";
echo "Text before remove:
" . $mainstr;
echo "

Text after remove: 
" . trim($mainstr, '@!.');
?>
Comment

removed spacel caracter using php

<?php
$mainstr = "<h2>Welcome to <b>PHPWorld</b></h2>";

echo "Text before remove: 
" . $mainstr;

echo "

Text after remove: 
" .
    str_ireplace(array('&lt;b&gt;', '&lt;/b&gt;', '&lt;h2&gt;', '&lt;/h2&gt;'), '',
    htmlspecialchars($mainstr));
?>
 output: 
  Text before remove: 
<h2>Welcome to <b>PHPWorld</b></h2>

Text after remove: 
Welcome to PHPWorld
Comment

removed spacel caracter using php

<?php
$strTemplate = "My name is :name, not :name2.";
$strParams = [
    ':name' => 'Dave',
    'Dave' => ':name2 or :password',
    ':name2' => 'Steve',
    ':pass' => '7hf2348', ];
echo "
" . strtr($strTemplate, $strParams) . "
";
echo "
" . str_replace(array_keys($strParams), array_values($strParams), $strTemplate) . "
";


?>
  Output:

My name is Dave, not Steve.
My name is Steve or 7hf2348word, not Steve or 7hf2348word2.
Comment

PREVIOUS NEXT
Code Example
Php :: sleep microseconds php 
Php :: array_unique 
Php :: Error Call to undefined function CodeIgniterlocale_set_default() 
Php :: beaver builder shortcode post title 
Php :: laravel 9 route controller group 
Php :: laravel old request htmlselect 
Php :: laravel clear everything 
Php :: how to get browser info in php 
Php :: take files from one folder and move to another folder in php 
Php :: laravel test assert redirecto to 
Php :: pusher-php-server laravel 
Php :: wp revisions 0 
Php :: comment supprimer balise script hmtl en php regex 
Php :: set charset of response php 
Php :: laravel session has message 
Php :: get index of element in array php 
Php :: wordpress user enumeration 
Php :: laravel convert datetime to date 
Php :: laravel eloquent get 10 records 
Php :: first day of month php 
Php :: php get method name 
Php :: laravel password verification 
Php :: how to create controller in specific folder laravel 
Php :: wordpress thumbnail url 
Php :: how to start a session 
Php :: echo first 100 prime numbers php 
Php :: guzzle http try catch 
Php :: magento2 memory limit 
Php :: homebrew switch php version 
Php :: wordpress update post php 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =