How to remove   characters from string with PHP

1 Answer

0 votes
$s = " \$this->content[0] ";
echo $s . "<br>\n";
$s = preg_replace("/\s|&nbsp;/", '', $s);

echo $s;



/*
run:

&nbsp;$this->content[0]&nbsp;<br>
$this->content[0]

*/

 



answered Jul 30, 2020 by avibootz
...