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.