如何在php中显示两种不同语言(印地文/英文)的字符串(How to display a string that is in two different languages (Hindi/English) in php)

其他开发 IT屋
问 题

I have a string "यदि आपको SALARY की EXPECTATION ज्यादा है तो आप WORK भी ज्यादा कीजिये !". This string contains Hindi and English words.

What I want is to display the very same string to my users. I tried putting same string in Text-box but it didn't work for me.

To make own Richtext Box may be an option for this, but I want Hindi fonts to be displayed in different Font say "Arial Black" and English should be displayed in different say "Arial Narrow". Also I have my own font that needs to be in Richtext Box to display Hindi words. And for English words I decided to show them in "Arial" with Bold fonts.

解决方案

You need to set charset to utf-8 in the <head> section of the page

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

You need to put <span> tags around English and Hindi words so that you can set different font for them as suggested by @halfer

<span style="font-family:Arial Black;">यदि आपको</span>
<span style="font-family:Arial;">EXPECTATION </span>

本文地址:IT屋 » How to display a string that is in two different languages (Hindi/English) in php

问 题

我有一个字符串“SALARY”,这个字符串表示的是“WORK WORKING”字符串。这个字符串包含印地语和英文单词。



我想要的是向我的用户显示相同的字符串。我试图在文本框中放入相同的字符串,但它并没有为我工作。

要使自己的Richtext框可能是一个选项,但我想印地文字体以不同的字体显示“Arial Black”,英文显示为不同的“Arial Narrow”。另外我有我自己的字体,需要在Richtext Box中显示印地文单词。对于英文单词,我决定用粗体字体显示在“Arial”中。

c> charset 到 utf-8 在页面的< head> 部分

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


您需要将< span> 标签围绕英语和印地语单词,以便您可以为他们设置不同的字体为@halfer建议



 < span style = font-family:Arial Black;“>有用的< / span> 
< span style =“font-family:Arial;”> EXPECTATION< / span>

本文地址:IT屋 » 如何在php中显示两种不同语言(印地文/英文)的字符串