我在PHP中有一个数组,其中包含泰语值。
当我使用json_encode
传递javascript中的值时json_decode
不会给出输出,返回空白。
print_r ($myarray)
以泰语返回输出。
json_encode($myarray)
返回输出' \u0e23
'。
如何将其转换为泰语输出。
答案 0 :(得分:0)
函数本身modifies the codification字符串。
将此作为第二个参数:JSON_UNESCAPED_UNICODE
json_encode( $myarray, JSON_UNESCAPED_UNICODE );
查看constants并选择最适合您。