波斯语言的php编码 [英] php encoding for persian language

查看:157
本文介绍了波斯语言的php编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我有以下代码:

Hi I have this code:

<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
    <meta charset="utf-8"/>
</head>
<body>
<style>
*{
	font-family:tahoma;
}
</style>
<center>
	<?php
	$dir="./texts";
	if ($handle = opendir($dir)) {
		while (false !== ($file = readdir($handle))) {
			echo "<div class='_item'>";
			echo "<a href='".utf8_decode($file)."'></a><br />";
			echo "</div>";
		}
		closedir($handle);
	}
	
	
	
	?>
</center>
</body>
</html>



我在这个目录"./texts"中有这个文件:



and i have this files in this dir "./texts":

test.txt
تست.txt



但我明白了:



but i get this:

.
..
test
���



我无法通过正确的编码获得تست. :(



i can''t get تست with right encoding. :(

推荐答案

dir = " ; 如果(
dir="./texts"; if (


handle = opendir(
handle = opendir(


dir)){ while (false!==(
dir)) { while (false !== (


这篇关于波斯语言的php编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆