我需要将带有unicode \ xCODEs的字符串转换为常规字符串。 问题是我输入的字符串似乎是单引号。
有没有办法将单引号字符串转换为double?
以下是一些可以更好理解的代码:
$s1 = '(single quotes): Conductivity @ 20\xc3\x82\xc2\xb0C';
$s2 = "(double quotes): Conductivity @ 20\xc3\x82\xc2\xb0C";
echo "<br>";
echo iconv("UTF-8", "ISO-8859-1//IGNORE", $s1);
echo "<br>";
echo iconv("UTF-8", "ISO-8859-1//IGNORE", $s2);
将输出:
(single quotes): Conductivity @ 20\xc3\x82\xc2\xb0C
(double quotes): Conductivity @ 20°C
提前致谢!