I have a problem right now. When someone is ordering something which contains the character "æ", it make it into "à¦", which destroys the mysql query, and ends the sentence there. For an example i got this:
#55*2*195*1 - 1,%%%%38. Burger dobbelt %%%%Kommentar%%%%Burgeren skal và¦re med friske agurker i stedet for syltede%%%%og uden ost. Pॠforhà¥nd tak %%%%%%%%100. Lasagne %%%%Dressing%%%%Ingen dressing,*;;124.20;;Niklas Smietana;;;;7;;*#
But when it insert it into the database, it ends up being like this:
#55*2*195*1 - 1,%%%%38. Burger dobbelt %%%%Kommentar%%%%Burgeren skal v
It just ends there. So what i want to do is that i want to replace every special characters like "æ", "ø", "å", "ü", "ö" and so on, in the "string", so it becomes "ae", "oe", "aa", "u", "o". I have tried with str_replace but it wont do it.
My code:
$product_name = $row['product_names'];
$product_name = str_replace("ø", "oe", $product_name);
$product_name = str_replace("É", "É", $product_name);
$product_name = str_replace("Ã", "à", $product_name);
$product_name = str_replace("¿", 'oe', $product_name);
$product_name = str_replace("¾", 'ae', $product_name);
$product_name = str_replace("æ", 'ae', $product_name);
$product_name = str_replace("Œ", 'aa', $product_name);
$product_name = str_replace("å", 'ae', $product_name);
$product_name = str_replace("š", 'oe', $product_name);
$product_name = str_replace("Ÿ", 'u', $product_name);
Do anybody in here have a solution on that?
Thanks in advance.