0

Hi I'm having some difficulty with escaping double quoutes from a string.

Here's my situation:
I get the the result set from the database then I apply utf8_encode to it because there's latin/accented characters and it return the string as it should be exept the double quotes in the begin and end of the string.

If in the DB I have: "Olá João" it returns: Olá João. The double quotes are ignored

$rs   = mysql_fetch_array($query)
$text = utf8_encode($rs['l_reference']);
echo $text;

I tried using addslashes but without success.

4

1 回答 1

0

我认为这是因为“Olá João”是一个多字节字符串,您必须为此使用不同的解决方法。试试这个mb_addslashes

于 2012-12-27T10:22:34.623 回答