Home >Backend Development >PHP Problem >How to remove nbsp in php
How to remove nbsp from php: First create a PHP code sample file; then pass "preg_replace("/(\s|\ \;| |\xc2\xa0)/", " ", strip_tags( $val));" method can remove all nbsp.
Recommended: "PHP Video Tutorial"
php Remove all & nbsp and html tags (& nbsp Line break)
The code method is as follows:
preg_replace("/(\s|\ \;| |\xc2\xa0)/", " ", strip_tags($val));
The above is the detailed content of How to remove nbsp in php. For more information, please follow other related articles on the PHP Chinese website!