I'm trying to convert a string from this: “é” to this: “é”. It's a latin1 character but I can't do it right. So far I've tried two functions but none of them give me the right output.
$translation = 'Copà © rnico was Italian';
$translation = mb_convert_encoding($translation, 'utf-8', 'iso-8859-1'); //opt 1
$translation = iconv('utf-8', 'latin1', $translation); //opt 2
I'm getting this data from an Api so I don't know what's going on in the database. This is the string in Spanish: Copérnico es italiano. This is the data from the API: Copà © rnico is Italian This is the result with $translation = bin2hex($translation); 436f70c38320c2a920726e69636f206973204974616c69616e
What's the right way to go? Greetings.