PHP print() Arabic string

后端 未结 5 1736
无人共我
无人共我 2021-01-20 05:32

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 <

5条回答
  •  南笙
    南笙 (楼主)
    2021-01-20 05:59

    You may want to set

    default_charset = "utf-8"
    

    in your php.ini. Default charset directive instructs the server to produce correct content type header.

    You can also do it in runtime:

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

提交回复
热议问题