2013-03-02 61 views
0

我無法使英鎊符號在標題標記中正確顯示。動態生成標題標記中的英鎊符號

我試過使用英鎊出來作爲一個?在鑽石中。我也嘗試過:

£ 

但是這樣出來。

我也曾嘗試設置:

header('Content-Type: text/html; charset=utf-8'); 

之前的輸出是呼應。

這裏是我正在生成標題標籤的內容:

public function marginAttribution($enquiryId) 
    { 

    $data = $this->model->marginAttribution($enquiryId) ; 

    $output = ''; 
    $output .= 'Sales value (parts): '.$data['sellingCurrency'].number_format($data['sellingValueNative'], 2, '.', ',')."\n"; 
    $output .= 'Sales value (fees): '.$data['sellingCurrency'].number_format($data['sellingFees'], 2, '.', ',')."\n"; 
    $output .= 'Sales value total ('.$data['sellingCurrency'].'): '.$data['sellingCurrency'].number_format($data['sellingFees']+$data['sellingValueNative'], 2, '.', ',')."\n"; 
    $output .= "Sales value total (£): £".number_format(($data['sellingFees']+$data['sellingValueNative'])/$data['sellingCurrencyRate'], 2, '.', ',')."\n"; 
    header('Content-Type: text/html; charset=utf-8'); 
    echo $output; 
    } 
+0

[在Web應用程序中處理Unicode前後](http://kunststube.net/frontback/) – deceze 2013-03-02 12:52:03

+0

@deceze我的數據庫設置爲utf-8,頁面編碼也設置爲html5版本的標記,我試圖在涉及的腳本中使用header()函數。還沒有運氣。 – imperium2335 2013-03-02 13:02:25

+1

您的文件*是否以UTF-8編碼? – deceze 2013-03-02 13:03:30

回答