如何在php中显示两种不同语言(印地语/英语)的字符串[关闭]

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>

In your HTML page add in head section:

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

Also you can do:

Changing the server encoding PHP header() function The simplest way to handle this problem is to send the encoding yourself, via your programming language. Since you're using HTML Purifier, I'll assume PHP, although it's not too difficult to do similar things in other languages. The appropriate code is:

header('Content-Type:text/html; charset=UTF-8');

...replacing UTF-8 with whatever your embedded encoding is. This code must come before any output, so be careful about stray whitespace in your application (i.e., any whitespace before output excluding whitespace within tags). PHP ini directive PHP also has a neat little ini directive that can save you a header call: default_charset. Using this code:

ini_set('default_charset', 'UTF-8');

...will also do the trick. If PHP is running as an Apache module (and not as FastCGI, consult phpinfo() for details), you can even use htaccess to apply this property across many PHP files:

php_value default_charset "UTF-8"

As with all INI directives, this can also go in your php.ini file. Some hosting providers allow you to customize your own php.ini file, ask your support for details. Use:

default_charset = "utf-8"