search

Home  >  Q&A  >  body text

laravel5.1 Chinese garbled code

public function index()
{
echo 'Hello friend';exit;
}
Page output Huanhui chain concubine

Where do I need to set it?

仅有的幸福仅有的幸福2794 days ago394

reply all(2)I'll reply

  • 阿神

    阿神2017-05-16 16:49:10

    Set the meta of html and specify the character encoding. If the php code is utf8, just add a tag to specify that the html encoding is also utf8.

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 16:49:10

    header function. Go check the manual. header("charset=UTF-8")

    reply
    0
  • Cancelreply