Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php remove double spaces to single space

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

PREVIOUS NEXT
Code Example
Php :: preg_match number only in php 
Php :: ternary operator laravel blade 
Php :: How can I prevent SQL injection in PHP? 
Php :: php explode 
Php :: phpspreadsheet password protected 
Php :: how change the languge of fie manager in laravel 
Php :: take fraction of number in laravel 
Php :: delete uploaded media file wp using code 
Php :: wordpress display post comment number 
Php :: array_intersect php 
Php :: php loop through objects 
Php :: magento 2 get collection 
Php :: pathtophp in ubuntu lampp 
Php :: guzzlehttp post json example 
Php :: remove special character in php 
Php :: select sum in laravel 
Php :: how to increase request timeout in laravel 
Php :: write file in php 
Php :: add seconds to datetime carbon 
Php :: laravel subdays 
Php :: woocommerce if it is shop page remove breadcrumbs 
Php :: open php ini from terminal 
Php :: laravel check if session variable exists 
Php :: object to string php 
Php :: php remove all parameter from url 
Php :: laravel check collection has key 
Php :: take last four digits php 
Php :: add column in table laravel 
Php :: serialize() php 
Php :: php search in object. array 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =