|
本帖最后由 zmm1030 于 2010-7-12 13:10 编辑
controllers 文件本身编码 ANSI
function 代码
$date['name'] ='显示头部';
$this->load->view('./admin/main',$date);
views部分,文件我也改成UTF-8,在配置文具里默认也是UTF-8 $config['charset'] = "UTF-8";
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php echo $name; ?>
如果是GB2312就没问题。
不然的话,session报错
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at E:\xampp\htdocs\bus\system\application\controllers\admin\indexs.php:1)
Filename: libraries/Session.php
Line Number: 662
将controllers的文件编码改成UTF-8(请不要用记事本,我就是用记事本改所以才出错的)
将views的文件编码改成UTF-8(请不要用记事本,我就是用记事本改所以才出错的)
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
就OK了~ |
|