首页 > Web开发 > 详细

yii和php的一些细节

时间:2014-01-26 17:32:50      阅读:488      评论:0      收藏:0      [点我收藏+]

yii   index.php

ini_set("display_errors", 1);

 

 

 

 

iconv这个函数不能直接用 需要检测!!!

function gb2312_utf8($str = ""){
    if(function_exists("iconv")){
        return iconv("gb2312", "utf-8//IGNORE", $str);
    }else if(function_exists("mb_convert_encoding")){
        return mb_convert_encoding($str, ‘UTF-8‘, "gb2312");
    }else{
        die(‘gb2312_utf8 occur error!‘);
    }
}


function utf8_gb2312($str = ""){
    if(function_exists("iconv")){
        return iconv("utf-8", "gb2312//IGNORE", $str);
    }else if(function_exists("mb_convert_encoding")){
        return mb_convert_encoding($str, ‘gb2312‘, "UTF-8");
    }else{
        die(‘utf8_gb2312 occur error!‘);
    }
}

yii和php的一些细节

原文:http://www.cnblogs.com/jami918/p/3534008.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!