小编Sae*_*eid的帖子

使用php读取波斯语(Unicode字符)文本文件

我在下面的代码的帮助下阅读一个波斯语文本文件(使用PHP):

/* Reading the file name and the book (UTF-8) */
if(file_exists($SourceDirectoryFile))
{
        $NameBook  = "name.txt";
        $AboutBook = "about.txt";

        $myFile = "Computer-Technolgy/2 ($i)/".$NameBook;
        $fh = fopen($myFile, 'r');
        $theData = fread($fh, filesize($myFile));
        fclose($fh);
        echo 'Name file: '. $theData.'<hr/>';
}
Run Code Online (Sandbox Code Playgroud)

name.txt文件内容:

????? ???? ??? ????????? (LEARNING NETWORK)
Run Code Online (Sandbox Code Playgroud)

姓名档案: (学习网络)

php fopen utf-8 fread

2
推荐指数
1
解决办法
2935
查看次数

标签 统计

fopen ×1

fread ×1

php ×1

utf-8 ×1