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!');
    }
}

最新文章

  1. PHP data
  2. ubuntu彻底卸载mysql
  3. Leap Motion发布新平台,直击下一代移动端VR/AR手部追踪
  4. Conntect Bluetooth devices in iOS.
  5. Ubuntu LAMP搭建
  6. Linux+Apache+Tomcat集群配置
  7. openstack手动玩转
  8. AngularJs练习Demo13Provider_factory
  9. WIFI机器人网
  10. 设置应用栏(Setting Up the App Bar)
  11. Java集合类源码解析:Vector
  12. java第7次作业
  13. bootstrap 坑
  14. Swinject 源码框架(一):基本原理
  15. chrome浏览器视频插件
  16. win7下安装ubuntu双系统的方法及心得体会(ps:要死好几回的节奏)
  17. Luogu_2774 方格取数问题
  18. WPF 动画:同为控件不同命 - 简书
  19. Electron小记
  20. PHP实现对站点内容外部链接的过滤方法

热门文章

  1. Access应用笔记<二>
  2. HDOJ 4750 Count The Pairs
  3. 【C语言入门教程】3.2 数据的输入 与 输出
  4. 【血的教训】玩 Ubuntu 遇到的致命问题(进不了系统)及 解决方案
  5. php正则
  6. iOS开发——UI进阶篇(十四)modal
  7. UNITY3d在移动设备上的一些优化实战(一)-概述
  8. Apache shutdown unexpectedly启动错误解决方法
  9. Droid4x快照还原
  10. phpcms更换域名用户无法注册问题