Utf8 and utf in PHP Development

Source: Internet
Author: User
I believe that a lot of PHPer at the beginning will also have such doubts, after hitting the wall to sum up the following: A, UTF-8 this is a standard writing, in PHP and HTML set encoding, unified written UTF-8. Example: PHP? Phpheader (Content-Type: texthtml; charsetUTF-8 );? Metahttp-equivContent-Typecontentte in HTML

I believe that a lot of PHPer at the beginning will also have such doubts, after hitting the wall to sum up the following: A, UTF-8 this is a standard writing, in PHP and HTML set encoding, unified written UTF-8. Example: PHP? Php header ('content-Type: text/html; charset = UTF-8 ');? Meta http-equiv = "Content-Type" content = "te

I believe that many PHPer may have such doubts at the beginning. The following is a summary after hitting the wall:

One, "UTF-8" this is the standard writing, set the encoding in PHP and HTML, unified writing "UTF-8 ".
Example:
PHP --
HTML --

2. "utf8", "UTF-8", and "UTF8" are only case-insensitive in windows. Generally, they can be recognized by programs, but there are exceptions. For example, the abbreviated "UTF8" or "utf8" is not recognized in IE.

3. In the database command mode, you must write "utf8", because MySQL command mode can only recognize "utf8". For example, you can write in a PHP program:
   Mysql_set_charset ('utf8', $ link );
?>

Conclusion: MySQL uses "utf8" [mysql_query (set names utf8)] and "UTF-8" for others ".

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.