$str = "& &svnips  ∴ ≈ osidnviosd & sopinsdo";
$regex = "/&[^\w;]/";
echo preg_replace($regex, "&", $str);
I'm trying to replace all un-encoded ampersands with encoded ones.
The problem is it's removing the space between &
and sopinsdo
.
Any idea why?