gpt4 book ai didi

php - 返回存储为 utf8_general_ci 和/或 utf8_unicode_ci 的数据库结果时,是否应该使用 utf8_decode?

转载 作者:行者123 更新时间:2023-11-29 14:55:13 24 4
gpt4 key购买 nike

在返回存储为 utf8_general_ci 和/或 utf8_unicode_ci 的数据库结果时,我应该使用 utf8_decode 吗?还是只是确保文件编码、HTML 内容类型和数据库存储都匹配吗?

最佳答案

嘿,

我认为不需要使用任何解码,只需:

header('Content-type: text/html; charset=utf-8');

在你的 php 脚本中,并且

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

在 html 页面中。

关于php - 返回存储为 utf8_general_ci 和/或 utf8_unicode_ci 的数据库结果时,是否应该使用 utf8_decode?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4792766/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com