Search
 
SCRIPT & CODE EXAMPLE
 

PHP

remove space from string php

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

remove every whitespace php

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

remove spaces from string php

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

remove whitespace from string php

$str = "


Hello World!


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

php remove all whitespace from a string

//remove all white spaces from a string
$whatonearth=preg_replace('/s/','',"what o n   ear th");
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

PHP rtrim — Strip whitespace (or other characters) from the end of a string

<?php

$text = "		These are a few words :) ...  ";
$binary = "x09Example stringx0A";
$hello  = "Hello World";
var_dump($text, $binary, $hello);

print "
";

$trimmed = rtrim($text);
var_dump($trimmed);

$trimmed = rtrim($text, " 	.");
var_dump($trimmed);

$trimmed = rtrim($hello, "Hdle");
var_dump($trimmed);

// trim the ASCII control characters at the end of $binary
// (from 0 to 31 inclusive)
$clean = rtrim($binary, "x00..x1F");
var_dump($clean);

?>
Comment

PREVIOUS NEXT
Code Example
Php :: ubuntu install lamp and phpmyadmin 
Php :: laravel required_with 
Php :: laravel blade upper case 
Php :: how to display user id from a function on a wordpress page 
Php :: how set field after another field in migration in laravel 
Php :: datetime php 
Php :: wordpress get permalink taxonomy id 
Php :: php search the key off bigger value 
Php :: get the current date and time in php 
Php :: laravel 8 insert multiple rows 
Php :: php basename from path 
Php :: simple localhost php 
Php :: find curren monday in laravel carbon 
Php :: php declare strict_types 
Php :: check current pages is a child page wordpress 
Php :: carbon laravel d m y to y-m-d 
Php :: php mkdir with 777 permission 
Php :: date format change in laravel 
Php :: php remove everything after symbol 
Php :: shortcut vsc select line up 
Php :: php sort array of array by key 
Php :: 18 year back date in php 
Php :: display time php 
Php :: convert numeric array to string array php 
Php :: replace multiple characters one string php 
Php :: nested resources laravel 
Php :: get ip address in laravel 
Php :: codeigniter 3 send email smtp 
Php :: enque scripts from plugin 
Php :: laravel deleted controller still cached 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =