I have a site scraped into $html variable.
now i want to replace some chars with this expression
$string1 = preg_replace('/[^A-Za-z0-9äöü!&_=\+-]/i', ' ', $string);
The Problem is there are special characters caused by different charsets.
I have a variable $charset in which the charset string of the page is saved. i.e. $charset="utf-8" or iso-8859-1 in utf-8 it's the german letter ü i want to replace in iso-8859-1 it's ü
Is there a possibility to tell the replace function according to the charset of the page without making separate Regular Expressions for each possible charset?