Home >> PHP >> how to remove nbsp from string in PHP

how to remove nbsp from string in PHP

$string="This is first line.  ";
$result = str_replace(" ", "", $string);
echo $result;

Output

This is first line. 

Post Your Comment

Next Questions
How to remove all whitespace from a string
How to convert array to string separated by comma
How to list last 12 months from current month
Get the last 12 months from current month
How to list last 6 months from current month
Get the last 6 months from current month
How to list last 12 months from current month by loop
Get the last 12 months from current month by loop
How to list last 6 months from current month by loop
Get the last 6 months from current month by loop
Differentiate between variables and constants
How to increase maximum execution time
How to Increase File Upload Size
Set maximum execution time
Set maximum execution time unlimited
What are the rules for naming a variable
How can you compare objects
Some of the popular frameworks
How to concatenate two strings
How to encrypt password

Copyright ©2022 coderraj.com. All Rights Reserved.