How to remove (that are hidden) and SPACES in below text but
tag
Not tested, but if you use something like:
$string = preg_replace("/\s/",'',$string);
That should remove all spaces.
UPDATE
To remove all spaces and references, use something like:
$string = preg_replace("/\s| /",'',$string);
UPDATE 2
Try this:
$string = html_entity_decode($string);
$string = preg_replace("/\s/",'',$string);
echo $string;
Forgot to say, reconvert the html entities so add this after the replacement:
htmlentities($string);