php var_dump()不显示非英语字符
我现在从事日本项目。当我使用var_dump()时,日语字符在浏览器中无法正确显示。但英文字符显示正确。我怎样才能解决这个问题。下面是我的var_dump()结果的一部分php var_dump()不显示非英语字符,php,utf-8,Php,Utf 8,我现在从事日本项目。当我使用var_dump()时,日语字符在浏览器中无法正确显示。但英文字符显示正确。我怎样才能解决这个问题。下面是我的var_dump()结果的一部分 'id' => int 71680 'customer_id' => int 16161 'amount' => string '1' (length=1) 'second_customer_id' => null 'second_amount' => null 'cust
'id' => int 71680
'customer_id' => int 16161
'amount' => string '1' (length=1)
'second_customer_id' => null
'second_amount' => null
'customer_name' => string '飛知和 啓一' (length=18)
'second_customer_name' => null
'payment_flag' => string '掛' (length=3)
'payment_flag_id' => int 2
'order_id' => int 9108
'article_name' => string 'ç¥å£‡' (length=6)
'article_id' => int 1000001
'sales_price' => string '200000.0' (length=8)
'discount' => int 0
'ceremony_cooking_category_id' => null
'payment_date' => string '2014/12/05' (length=10)
'payment_hour' => string '0' (length=1)
'payment_min' => string '0' (length=1)
'hall_id' => null
'hall_name' => null
'hall_address' => null
'hall_tel' => null
'stock_date' => null
'stock_confirm_emps_name' => null
'check_date' => null
'check_emps_name' => null
'note' => string 'memo 333' (length=8)
'label' => string 'label 333' (length=9)
加
在
var\u dump
之前,将utf8
更改为数据库使用的编码。使用内容类型:text/plain
和charset=utf-8
,这将强制输出以纯文本呈现
在输出任何内容之前添加此行
header("Content-Type: text/plain; charset=utf-8");
参考资料:你能把你的头也贴在这里吗?如果你感到困惑,你需要告诉hi使用utf-8,如果你不这样做,它将是一个错误problem@user2860957你说的头是什么意思?你是说html头标签吗?请你解释一下好吗?我可能错了,因为var dump不会返回任何东西,但我想使用head并告诉它使用utf-8可以帮助你,是的,我是说html head一些东西,比如
,我在我这边检查过,很好,你是从数据库返回这些值吗???@user2860957是的,这些值是从数据库返回的。
header("Content-Type: text/plain; charset=utf-8");