Last active
May 9, 2019 06:46
-
-
Save yehchge/80afe8651ff511e86e7095e05a588f84 to your computer and use it in GitHub Desktop.
php file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Replace non-breaking spaces with normal spaces | |
* | |
* @param $str | |
* @return string | |
*/ | |
function removeNbsp($str) | |
{ | |
$str = trim($str); | |
$str = preg_replace('/ /is',' ', $str); | |
$str = html_entity_decode($str); | |
return $str; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment