PHP print() 阿拉伯字符串 [英] PHP print() Arabic string

查看:28
本文介绍了PHP print() 阿拉伯字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试执行此代码以打印出阿拉伯字符串时:print("إضافة"); 我得到此输出:إضاÙØ©.如果我 utf8_decode() 它我会得到 ?????.我的 apache 配置中有AddLanguage ar",但没有帮助.我如何打印出这个阿拉伯字符串?

When I try and execute this code to print out an Arabic string: print("إضافة"); I get this output: إضاÙØ©. If I utf8_decode() it I'll get ?????. I have "AddLanguage ar" in my apache configuration but it doesn't help. How do i print out this Arabic string?

推荐答案

同时将你的页面语言设置为 utf8 eg:

Also set your page language to utf8 eg:

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

然后看看它是否有效.如果还是不行,去看看这个,这是使用 PHP 的阿拉伯语言的完整解决方案:

and then see it if worked. If that still doesn't work, go and check this out, it is complete solution for the arabic language using PHP:

http://www.ar-php.org/en_index_php_arabic.html

你可能也想看看这个:

http://www.phpclasses.org/browse/package/2875.html

这篇关于PHP print() 阿拉伯字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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