数据表没有使用符号

时间:2017-01-16 03:42:05

标签: php json datatable

我正在使用datatables和json。如果我的数据表中没有这个符号,那么它能正常工作。但是,当我有这个 在我的数据表上显示警告

DataTables Warning : table id=tbl_prkp - Invalid json not responding blalalala..

当我在mysql数据库上搜索时,我发现在我的桌子上有像“²”或“〜”这样的符号,或者像我的描述中那样的antoher符号。我该如何替换那个符号?原因是我的DataTables没有显示。抱歉,我的英文。,

更新: 解决!!感谢Lea Tano !!!

1 个答案:

答案 0 :(得分:2)

您可以使用uft8_encodeuft8_decode这会将您的数据从ISO-8859-1编码转换为UTF-8,反之亦然。确保正确存储数据。

参考:

http://php.net/manual/en/function.utf8-encode.php

http://php.net/manual/en/function.utf8-decode.php

示例:https://3v4l.org/KI9A3