PHP in UTF8 and utf-8

Source: Internet
Author: User

I believe a lot of programmers will have this kind of doubt at first, title, I also.
In fact, they can be distinguished by this.
First, in PHP and HTML set code, please try to write "UTF-8", this is the standard notation, and Utf-8 is only in the window is not a case-sensitive way of writing, and secondly, most of the cases are written "UTF8" or "UTF8" program can also be recognized, But in IE browser does not recognize it, so, best, strictly written "UTF-8", such as:
<?php header (' content-type:text/html; Charset=utf-8 ');?>
<meta http-equiv= "Content-type" content= "text/html; charset=utf-8" />
Second, in the database Setup code, must be written as "UTF8", because the MySQL command mode can only identify "UTF8", do not recognize "utf-8", such as: PHP program can write:
<?php mysql_set_charset (' UTF8 ', $link); ?>

PHP in UTF8 and utf-8

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.