2013-02-28 48 views
0

我是implimenting語言模塊使用ini文件。所以我插入標籤和它的值到ini文件,但值插入像??? ?????用阿拉伯語言。陣列阿拉伯數值沒有顯示,並正確地插入ini文件

我已經添加

//in header section 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">  

//in php section 
    ini_set('default_charset','utf-8');  
    header("Content-Type: text/html; charset=UTF-8"); 

而且我有添加下面一行而ini文件

utf8_encode($elem); 

我想補充並更新已添加INI值進行串。請告訴我如何去做一切。

在此先感謝。

+1

變化分貝,表,列排序規則爲'utf8_general_ci'。 – 2013-02-28 05:33:55

+0

@Yogesh讓它回答。 – 2013-02-28 05:49:19

+0

但我沒有使用數據庫。我只是在文本框中添加值,並在發佈它的標籤時存在,然後更新或插入到ini文件中。 – 2013-02-28 05:52:14

回答

0

它適合我。你能提供一些代碼你試過了嗎?

t.php

$ file -bi t.php 
text/html; charset=us-ascii 

<? 
if ($_POST && isset($_POST['t'])) { 
    $h = fopen('/tmp/h.txt', 'w'); 
    fwrite($h, $_POST['t']); 
    fclose($h); 

    readfile('/tmp/h.txt'); 
    exit; 
} 

?> 
<html> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">  
    </head> 
    <body> 
     <form method="post"> 
      <input type="text" name="t"> 
      <input type="submit"> 
     </form> 
    </body> 
</html> 

輸出後提交

enter image description here

文件提交後

$ file -bi /tmp/h.txt 
text/plain; charset=utf-8 

和網頁並提交數據

enter image description here