進出口試圖(通過另一個PHP頁面)更改php文件的編碼設置爲UTF-8,我的意思是沒有編輯器。我怎樣才能改變一個PHP頁面的編碼?
我試圖用的file_get_contents和file_put_contents。
我用這個代碼,但它不工作!
$text = file_get_contents('testencoding.php');
$text = mb_convert_encoding($text, "UTF-8");
file_put_contents('testencoding.php',$text);
上述代碼僅在頁面中存在「阿拉伯語」字符時纔有效。
感謝,
而在其他案件 - 它做了什麼?定義'不起作用'。如果你知道它,爲什麼不指定'from_encoding'? – zerkms
Im對不起英文不好,我不知道'from_encoding',因爲即時通訊製作網站將編碼從任何編碼轉換爲UTF-8,我嘗試使用'mb_detect_encoding',但它返回'布爾(false)'。 。 謝謝。 – Programmer4me