preg_replace lt preg_replace gt preg_replace amp preg_replace quot pre

1
2
3
4
5
6
$s = preg_replace('|&lt;|','<',$s);
$s = preg_replace('|&gt;|','>',$s);
$s = preg_replace('|&amp;|','&',$s);
$s = preg_replace('|&quot;|',"'",$s);
$s = preg_replace('|&nbsp;|',' ',$s);
$s = preg_replace('|<.+?>|','',$s);