How to set UTF-8 encoding for a PHP file

后端 未结 7 1491
-上瘾入骨i
-上瘾入骨i 2020-11-28 08:24

I have a PHP script called :

http://cyber-flick.com/apiMorpho.php?method=getMorphoData&word=kot

That displays some data in p

7条回答
  •  悲哀的现实
    2020-11-28 08:54

    Also note that setting a header to "text/plain" will result in all html and php (in part) printing the characters on the screen as TEXT, not as HTML. So be aware of possible HTML not parsing when using text type plain.

    Using:

    header('Content-type: text/html; charset=utf-8');
    

    Can return HTML and PHP as well. Not just text.

提交回复
热议问题