Settings
|
Sign in
|
Sign up
Bar
Post
Home
>
Bar PHP
>
View post
Reply the post
|
View all
The author has
3
posts.
PHP输出带有阿拉伯语的文字时,用不着调换冒号左右文字的顺序,更用不着判断语言。
Floor 1
巨大八爪鱼
7/14/15 17:25
例如:
<?php
$price_zhTW = "价格";
$price_ar = "السعر";
$price = "10";
?>
<p><?=$price_zhTW?>: <?=$price?></p>
<p><?=$price_ar?>: <?=$price?></p>
输出:
价格: 10
السعر: 10
其中浏览器已经自动调换了第二行冒号左右的文字顺序
Floor 3
巨大八爪鱼
7/14/15 17:27
因此在实际应用中,可以放心的使用下面的代码:
<?php echo _("Price") . ":" . $price ?>
然后在mo文件中分别提供"价格"和"السعر"这两个翻译。
Floor 4
巨大八爪鱼
7/14/15 17:28
源文件中也是这样。
Content converter:
No conversion
Mainland
Taiwan
Hong Kong
Singapore
Reply the post
Content:
User:
You are currently anonymous.
Captcha:
Unclear? Try another one.