简体   繁体   中英

General Best Practices for encoding using php

There are lots of questions about particular encoding problems but I could not find a good general best practices article. Basically my question(s) encompass:

  1. What meta-tags should I put in all my .php/.html files if any?
  2. What are good configuration settings for PHP.ini for supporting UTF-8. (As recommended by other articles here)
  3. How would I handle AJAX calls to php with the proper encoding?
  4. How would I save/load files to work well with the encoding settings of php?
  5. Any common gotcha's to look out for?

Php has so many encoding options its just a forest to navigate and it seems one good example of these details done properly will keep a lot of people out of trouble. I found an excellent article here which is a great intro but lacks the specific php practices I am looking for. See also https://phpbestpractices.org/ which has some good general guidelines.

啊,在这里找到了很好的资源: http : //blog.loftdigital.com/blog/php-utf-8-cheatsheet如果其他人有更好的建议,让我们在这里找到。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM