2017-04-26 79 views
1

我現在正在處理日文項目。當我使用var_dump()日語字符在瀏覽器中顯示不正確。但英文字符正確顯示。我該如何解決這個問題。我的var_dump()結果的下面部分,php var_dump()不顯示非英文字符

'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) 
+0

,你可以在這裏發表您的頭爲好,如果你是混淆你需要告訴喜來使用UTF-8,如果你不這樣做,這將有問題 – user2860957

+0

@ user2860957你是什​​麼意思?你的意思是HTML標籤? 你能解釋我嗎? –

+0

我可能是錯誤的,因爲var轉儲不返回一個東西,但我想使用頭,並告訴它使用utf-8可以幫助你,而我的意思是HTML頭像' ' – user2860957

回答

2

var_dump前添加

Header("Content-Type:text/html;charset=utf8"); 

,改變utf8到編碼數據庫中使用。

1

使用Content-Type: text/plaincharset=utf-8,這會強制輸出呈現爲純文本。

在輸出任何內容之前添加此行。

header("Content-Type: text/plain; charset=utf-8"); 

參考:Charset W3