我试图将 php 文件的编码(通过另一个 php 页面)更改为 UTF-8 ,我的意思是没有编辑器。
我尝试使用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);
仅当页面中有“阿拉伯”字符时,上面的代码才有效。
谢谢,