PHP是必要header('Content-type: text/html; charset=utf-8');
時是在htaccess中設置字符集時需要設置php字符集嗎?
AddDefaultCharset utf-8
<IfModule mod_mime.c>
AddCharset utf-8 .php .html .xml .css .js .json
</IfModule>
在我的.htaccess文件被定義爲集? .php文件是否受此規則影響?
我正在創建一個settings.cfg.php
-document,並想知道我是否真的需要這行代碼 - 如果它會有點矯枉過正。
我知道這並不是必需的,但強烈建議您將<meta charset="utf-8">
保留在index.php
-文檔中,因爲最終用戶無權修改我的Apache服務器設置。但是,這隻會影響到客戶端的內容,而不是內容獲取OG從服務器端用PHP創建 - 如果那所做的任何SENCE ...
編輯:這是我的index.php:
的負載。 initialize.php需要我settings.cfg.php文件,在最高層......
<?php require_once 'initialize/load.initialize.php'; ?>
<!DOCTYPE html>
<head>
<meta charset="utf-8">
...
</head>
<body>
<!--
this document includes page -header, -navigation, -content and -footer,
where the content-part is just including other .php content pages or fetching content from database.
-->
<?php require 'template/load.template.php'; ?>
</body>
</html>
Okey。這是我的。並感謝有關捲髮請求槽終端的提示。 – ThomasK 2013-04-27 23:56:28