At the moment I have:
//replace common characters
$search = array('&', '£', '$');
$replace = array('&', '£', '$');
$html= str_replace($search, $replace, $html);
The problem with this code is that if the & has been already converted it will try to convert it again. How would I make sure this doesn’t happen?
i give an example but it will work if you have the latter like
' & 'then hope this will work for you:but remember this will work if you have space on both sides of an ampersand or whatever you want. Otherwise follow the @Treffynnon Answer..