PHP except BOM header garbled

Source: Internet
Author: User
PHP garbled after removing BOM header
The program is written in the notepad++ text editor, and when the format is selected, and encoded in UTF-8 format, the Chinese characters (read from the database, stored in the $_session) are displayed normally, but the following warning appears

Warning:session_start () [Function.session-start]: Cannot send session cache Limiter-headers already sent (output Starte D at E:\wamp\www\biyesheji\login_check.php:1) in E:\wamp\www\biyesheji\login_check.php on line 1

Warning:cannot Modify header Information-headers already sent by (output started at E:\WAMP\WWW\BIYESHEJI\LOGIN_CHECK.P hp:1) in E:\wamp\www\biyesheji\login_check.php
Array ([username] = Zhang San [userid] = 2009011105 [role] + 3)

Login Successful!
Jump after 5 seconds

When the BOM header is removed, the warning disappears, but the Chinese characters all become garbled

Array ([username] = Liao incrementally 笁 [UserID] = 2009011105 [Role] = 3)
BNHI 綍 Contact radiation functions!
5 crepe 掗 clothed Å for configures Aachen accommodating vexed Qi

Find a way to solve


------Solution--------------------

Header (' content-type:text/html; Charset=utf-8 ');
Add a statement is UTF-8 code, otherwise the browser may be detected by itself
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.