yutian 发表于 2012-6-29 15:05:08

CI 2.1.1创建自己的类库出现乱码

本帖最后由 yutian 于 2012-6-29 15:06 编辑

这个是我创建的类库

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

    class Common{
      
      function mytest()
      {
            echo "测试";
      }
      
    }


控制器


<?php

    class Mytest extends CI_Controller{
      
      function __construct(){
            parent::__construct();
            $this->load->library('common');
      }
      function index(){
            $this->common->mytest();
      }
    }

输出的内容如下
娴嬭瘯
问一下这个怎么解决

浪迹天涯 发表于 2012-6-29 17:11:34

文件编码与浏览器编码的问题

alexskybin 发表于 2012-7-1 21:27:22

文件编码换成utf-8编码, html的meta标签设置html的编码为UTF-8

Hex 发表于 2012-7-1 22:24:37

要写完整html才可以呀!不能只输出几个字符
页: [1]
查看完整版本: CI 2.1.1创建自己的类库出现乱码